【发布时间】:2015-01-20 15:52:08
【问题描述】:
我正在处理具有包含空格的列名的数据库表,例如“级别描述”。
我无法更改列名。现在我有这个表的实体框架模型类,编译器抱怨这个属性,因为属性名称不能包含空格!
如何在我的类中定义带空格的列?
[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; }
}
【问题讨论】:
标签: c# entity-framework