What nhibernate mapping is used for string[] in an entity?

前端 未结 2 802
小鲜肉
小鲜肉 2021-01-24 00:42

I have a strange situation I need to persist:

public class Person
{
  public string[] Nicknames { get; set; }
}

What mapping and table structur

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-24 01:44

    You can use some logic of yours to achieve the same thing right.. probably adding your own delimiter between the nicknames and then split it by this delimiter once you read it into memory.

    public class Person
    {
      public string Nicknames { private get; set; }
    
      public string[] ArrayOfNicknames
      {
        get
        {
            return Nicknames.Split();
        }
      }
    }
    

提交回复
热议问题