Beginner |
|
Joined: Sat Dec 10, 2005 6:22 pm Posts: 28 Location: Chicago, IL
|
Use a proxy if you do not want to make all methods and properties virtual in your entity class.
Not sure about defining all mapped properties on the Interface, but I would assume so.
I used interfaces for all my proxies and when upgrading to 1.2 I had issues with critieria and proxies. I didn't look into it enough to get around to posting a possible bug, my fix was to ditch the interfaces and make everything virtual on the entity. Worked like a charm from that point on.
One big drawback to interfaces is the inability to load objects with them. I would like to see Session.Get(typeof(IEntity), 100) but of course NHibernate bombs here.
Not much advantage that I can see, almost makes for double work using interfaces. It is probably mostly a carry over from the hibernate port.
Adam
|
|