tags:

views:

95

answers:

1

Are there ORM tools for .NET supporting mapping of generic types?

I imagine at least two possible mapping scenarios:

  • Mapping of particular generic type instances
  • Mapping of all possible generic instances (based on constraints & other mapped types).
+1  A: 

I've been trying out Fluent NHibernate the last couple of months, and I'm pretty sure it can do that. We've certainly got generic lists as properties on objects. I'm not sure that I completely understand your second requirement. I've implement a generic repository that takes any type, and that works fine, if that's the sort of thing you are talking about?

Paul Manzotti
Note that Fluent NHibernate compliments NHibernate (very well), but you could use plain NHibernate without Fluent.
Tobin Harris
Also note that Ayende posted this in 2007. http://ayende.com/Blog/archive/2007/11/14/NHibernate-and-Generic-Entities.aspx. I haven't needed to use Generic types in my models, but it might help you get a feel for the issues with mapping generics in NH.
Tobin Harris