- 0
[C#] NHibernate
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Microsoft engineer shows how bad code can lead to your Windows PC slowing down
By hellowalkman,
- microsoft
- windows 11
- (and 12 more)
- 19 replies
- 0 views
-
Microsoft updates official lightweight Windows 11 Validation OS with DISM, WPF .NET upgrades
By hellowalkman,
- microsoft
- windows 11
- (and 9 more)
- 0 replies
- 0 views
-
- 0 replies
- 0 views
-
- 0 replies
- 0 views
-
Microsoft releases Microsoft.Extensions.AI .NET libraries for AI application development
By pradeepviswav,
- microsoft
- microsoft ai
- (and 5 more)
- 2 replies
- 5 views
-
Question
SuperKid
Hi,
I can't seem to get my code to work with NHibernate properly, what I am trying to do is Inherit my Database Entities into my classes, so i have it like this:
and
but in nHibernate if i do say session.Save(SomeClass); it doesn't work? it says there is no persister for "SomeClass" it seems to not understand that "DbEntity" which is Inherited is what needs to be used here, I have classes which include data I want to retrieve, save and update from my database using Hibernate but these classes are Inherited like deep down, but why won't Hibernate accept "SomeClass" and just cast it to DbEntity and work out what it needs??
Thanks!
EDIT: When i mean't .Save(SomeClass); i mean if i do like
var blah = new SomeClass(); session.Save(SomeClass);
Link to comment
https://www.neowin.net/forum/topic/1090343-c-nhibernate/Share on other sites
4 answers to this question
Recommended Posts