fluent-nhibernate

what does this error mean in nhibernate

偶尔善良 提交于 2019-12-23 06:49:08
问题 Out of the blue, i am getting this error when doing a number of updates using nhibernate. Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [MyDomainObject] there is no additional information in the error. Is there some recommended way to help identify the root issue or can someone give me a better explanation on what this error indicated or is a sympton around. Some additional info I looked at the object and all of the data looks fine, it has an ID,

what does this error mean in nhibernate

删除回忆录丶 提交于 2019-12-23 06:49:05
问题 Out of the blue, i am getting this error when doing a number of updates using nhibernate. Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [MyDomainObject] there is no additional information in the error. Is there some recommended way to help identify the root issue or can someone give me a better explanation on what this error indicated or is a sympton around. Some additional info I looked at the object and all of the data looks fine, it has an ID,

Error using $expand with NHibernate and webapi + OData

删除回忆录丶 提交于 2019-12-23 03:57:17
问题 When you run the query {{odata-url-prefix}}/ArquivosVenda(2)?$expand=Vendas an error is generated: { "odata.error": { "code": "", "message": { "lang": "en-US", "value": "An error has occurred." }, "innererror": { "message": "Argument types do not match", "type": "System.ArgumentException", "stacktrace": " at System.Web.Http.ApiController.<InvokeActionWithExceptionFilters>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime

NHibernate Mapping a Many to Many with Data on Join Table

佐手、 提交于 2019-12-23 03:29:13
问题 I have a User table and an Address table. They are connected by a join table. The mapping for that is straight forward, but I have some data on the join table that I would like to show up on the Address table. There may be a better way to set this up also, which I'm open to suggestions for. Here is the table structure. CREATE TABLE [dbo].[User] ( [Id] INT NOT NULL IDENTITY PRIMARY KEY, ... ) CREATE TABLE [dbo].[Address] ( [Id] INT NOT NULL IDENTITY PRIMARY KEY, ... ) CREATE TABLE [dbo].

How can change grouped List<MyClass> to list<MyAnotherClass> type?

放肆的年华 提交于 2019-12-23 03:26:12
问题 Here is my codes; public List<SbtKlasorViewModel> GetFoldersWithIndexedDocuments() { //TODO - I can't find right query. We need folders with documents but only documents which be Indexed using (ISession session = DatabaseProvider.SessionFactory.OpenSession()) { List<DokumanlarModel> dokumanList = session.QueryOver<DokumanlarModel>() .Where(x => x.IndexlenmeTarihi != null) .List().ToList(); var list = dokumanList.GroupBy(x => x.Klasor.Aciklama); List<SbtKlasorModel> folders = list as List

Fluent NHibernate Many to Many with extra column does not insert

谁都会走 提交于 2019-12-23 03:23:29
问题 I'm struggling with fluent nhibernate from Fluent Nhibernate Many-to-Many mapping with extra column I've copied the mappings and written the smallest program I can... but it wont save... Would anybody be able to provide some insight ??? public class Product { public int Id { get; set; } public string Name { get; set; } public IList<Inventory> Inventory { get; set; } public Product() { Inventory = new List<Inventory>(); } } public class Warehouse { public int Id { get; set; } public string

Updating child instead of deleting it

≯℡__Kan透↙ 提交于 2019-12-23 02:52:45
问题 Look at the entity - class Person { int id { get; set; }; IList<PersonAddress> Addresses { set; get; } ... } Now while updating person from UI if I just remove some addresses from the list of address then I wand to actually delete the address record from db. currently this is updating the address table setting personId = NULL and not deleting the address record. Does anyone know how to do this. may be some mapping issue. Here I am adding whole Person class mapping file. public class

FluentNhibernate HasMany with component

烂漫一生 提交于 2019-12-23 02:45:01
问题 i have this mapping: HasMany<ClassA>(ot => ot.AList) .Table("XPTO") .KeyColumn("IDXPTO") .Component(m => { m.Map(a=> a.X, "X"); m.Map(x=> x.Y, "Y"); }) .Cascade.AllDeleteOrphan(); i get an error saying that "refers to an unmapped class ClassA", but i shouldn't need to map it. i saw other examples in the internet with similar mappings and they don't have this problem... if i create a classMap for class A only with ID, then its works, but the data model will have 1 unecessary table for classA

FluentNHibernate Auto Mappings and ISet in .NET 4.0

好久不见. 提交于 2019-12-23 01:05:32
问题 How to set up auto mapping to map System.Collections.Generics.ISet<T> correctly? I tried implementing IHasManyConvention , but in intellisense it seems that IOneToManyCollectionInstance does not have anything for that(?) 回答1: This is not up to Fluent NHibernate, because NHibernate just doesn't have any built-in implementation for System.Collections.Generics.ISet<T> . If you really want to use .NET's ISet instead of Iesi.Collections, for now you'll have to write it yourself. Use

Fluent Nhibernate How to specify Id() in SubclassMap

亡梦爱人 提交于 2019-12-22 11:49:43
问题 I'm in the process of adapting Fluent NHibernate to our existing legacy app and am trying to determine how to use ClassMap and SubclassMap for the entity hierarchy shown. // BaseObject contains database columns common to every table public class BaseObject { // does NOT contain database id column public string CommonDbCol1 { get; set; } public string CommonDbCol2 { get; set; } // ... } public class Entity1 : BaseObject { public int Entity1Id { get; set; } // other Entity1 properties } public