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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t directly map it. There are two rules to consider:
IList<T>,IDictionary<K,V>)and never heard someone requesting it.
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:
EntityEntity_StringDictEntity_FKKeyEntity_StringDict_StringsEntity_StringDict_FKString