NotMapped注释不适用于EF6 CodeFirst

时间:2016-06-24 08:28:49

标签: entity-framework ef-code-first

我在使用我的数据模型。我不想用EF CodeFirst将一些字段存储到DB中,所以我做了:

using System.ComponentModel.DataAnnotations.Schema;

[NotMapped]
public int MyProp{ get; set; }

我还将AutomaticMigrationsEnabled设置为true,但在Update-Database之后,该字段显示在数据库中。

我使用EntityFramework 6.1.3。

那我该怎么办?在此先感谢您的帮助

0 个答案:

没有答案
相关问题