views:

146

answers:

2

How to set up auto mapping to map System.Collections.Generics.ISet<T> correctly?

I tried implementing IHasManyConvention, but in intellisense it seems that IOneToManyCollectionInstance does not have anything for that(?)

A: 

As far as I know, the only generic you can automap right out of the box (i.e. without Conventions, Overrides, or Mapping Classes) is IList.

I've seen a lot of people ask how to map IDictionary, and believe it is possible, but have not needed to do this myself.

But maybe if you do some searching on mapping IDictionaries, you'll learn enough to map an ISet. And if you succeed, please post the code here as an answer to your question!

Tom Bushell
+2  A: 

This is not up to Fluent NHibernate, because NHibernate just doesn't have any built-in implementation for System.Collections.Generics.ISet<T>.

If you really want to use .NET's ISet instead of Iesi.Collections, for now you'll have to write it yourself. Use PersistentGenericSet for reference.

Mauricio Scheffer