My class has a field of type Dictionary<string, List<string>>
. What's the best way to map it with NHibernate? I'd better leave it as a field, don't want to expose it.
Thanks a lot!
ulu
My class has a field of type Dictionary<string, List<string>>
. What's the best way to map it with NHibernate? I'd better leave it as a field, don't want to expose it.
Thanks a lot!
ulu
You can't directly map it. There are two rules to consider:
IList<T>
,IDictionary<K,V>
)Put your list of string into a class and use interfaces:
You might even see some advantages of having such a class.
Mapping:
Maps to three Tables:
Entity
Entity_StringDict
Entity_FK
Key
Entity_StringDict_Strings
Entity_StringDict_FK
String