我正在处理一个数据库表,其中一列名称中包含空格,例如“Level Description”。
我无法更改列名。现在我有一个Entity Framework模型类用于这个表,但编译器抱怨该属性,因为属性名不能包含空格!
我该如何在我的类中定义带空格的列?
[Table("StudyLevel")]
public class StudyLevelModel
{
[Key]
public byte StudyLevelID { get; set; }
// How to map this to the column "Level Description"?
public string Level Description { get; set; }
public string SLevelType { get; set; }
public Nullable<bool> IsActive { get; set; }
public string ESID { get; set; }
public string RID { get; set; }
public byte LevelSearchGroup { get; set; }
}