FluentNHibernate Auto Mappings and ISet in .NET 4.0

How do I set up auto mapping to display System.Collections.Generics.ISet<T>

correctly?

I tried to implement IHasManyConvention

, but in intellisense it seems like IOneToManyCollectionInstance

it has nothing to do with this (?)

+2


a source to share


2 answers


This is not Fluent NHibernate, because NHibernate simply does not have a built-in implementation for System.Collections.Generics.ISet<T>

.



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

+2


a source


As far as I know, the only generic type you can automate right out of the box (i.e. no conventions, overrides, or mapping classes) is IList.

I've seen a lot of people ask how to map an IDictionary and figure it is possible, but didn't have to do it myself.



But maybe if you do a search in cartographic dictionaries you will learn enough to map ISet. And if you succeed, post the code here as an answer to your question!

0


a source







All Articles