.NET 4: Native generic collection support (ISet) ?

ThomasB's Avatar

ThomasB

26 Oct, 2010 03:39 PM via web

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?

  1. Support Staff 2 Posted by James Gregory on 26 Oct, 2010 03:47 PM

    James Gregory's Avatar

    You can use HashSet with no problems.

    As for when true support will come, that'll depend entirely on when NH supports it.

  2. 3 Posted by ThomasB on 28 Oct, 2010 07:42 AM

    ThomasB's Avatar

    Ok fine, thanx! But I can't expose the generic interface right (of course I could expose it seperately and avoid mapping the property)?

  3. Support Staff 4 Posted by James Gregory on 03 Nov, 2010 03:07 PM

    James Gregory's Avatar

    You can expose a HashSet as an ICollection.

  4. 5 Posted by Christina Wosnitza on 24 Jan, 2011 01:24 PM

    Christina Wosnitza's Avatar

    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

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is two plus two?