Code First NotMapped

转载:http://www.cnblogs.com/libingql/p/3352058.html


不需要映射的字段,添加 NotMapped

6、非数据库字段属性

  在类中,如果有一些属性不需要映射到对应生成的数据表中,可以通过以下方式设置。

6.1 Data Annotation方式

[NotMapped]
public string Remark { get; set; }


原文地址:https://www.cnblogs.com/hanjun0612/p/9779901.html