How to map a column name with spaces in it to a POCO property?

前端 未结 2 1959
抹茶落季
抹茶落季 2021-01-05 07:57

I am working on database table which has a column name with a space in it, for example \"Level Description\".

I cannot change the column name. Now I have an Entity F

2条回答
  •  孤街浪徒
    2021-01-05 08:42

    Use the ColumnAttribute to set the name:

     [Column(Name="Level Description")]
     public string LevelDescription { get; set; }
    

提交回复
热议问题