.NET 4: Native generic collection support (ISet) ?
Since .NET 4 Microsoft has closed the gap for generic Sets. So there is now native support for generic Sets available:
System.Collections.Generic.ISet
When I tried to use it, FluentNH returned a type cast exception (obviosly Iesi.Collections.ISet is still used internally). What I didn't try yet is to use IEnumerable and then use Systems.Collections.Generic.HashSet (I guess Iesi.Collections.ISet should inherit from IEnumerable...)
My question is, can we expect native generic collection support for sets in the future?
Support Staff 2 Posted by James Gregory on 26 Oct, 2010 03:47 PM
You can use HashSet with no problems.
As for when true support will come, that'll depend entirely on when NH supports it.
3 Posted by ThomasB on 28 Oct, 2010 07:42 AM
Ok fine, thanx! But I can't expose the generic interface right (of course I could expose it seperately and avoid mapping the property)?
Support Staff 4 Posted by James Gregory on 03 Nov, 2010 03:07 PM
You can expose a
HashSet
as anICollection
.5 Posted by Christina Wosnitza on 24 Jan, 2011 01:24 PM
I just tried this, but it doesn't work with automapping out-of-the-box. Obviosly I miss to implement some kind of IConvention override, but I'm nut sure which I need to override and how it should basically look like.
As I feel this is related to this topic, here is the link for the new support platform:
http://stackoverflow.com/questions/1990593/is-it-possible-to-use-a-...
Thanks
Christina