Mapping collection of enum in NHibernate

2019-08-21 07:51发布

I have a class with collection of enums:

Class1.cs

public enum Language
{
    Serbian = 1,
    Croatian,
    Ukrainian,
}

public class Class1
{
   private IList<Language> m_languages = new List<Language>();
   public virtual IList<Language> Languages
   {
          get { return m_languages; }
          set { m_languages = value; }
   }
}

What is the content of mapping file for this class?

2条回答
一纸荒年 Trace。
2楼-- · 2019-08-21 08:35

As an alternative, you may want to consider something a little 'smarter' than enums; take for instance Fabio's Well Known Instance Type example - I find myself using these all the time for (relatively) static data.

查看更多
登录 后发表回答