如何使用 codefirst EF4 创建非持久属性?
MS 说有一个 StoreIgnore 属性,但我找不到它。
有没有办法使用 EntityConfiguration 进行设置?
最佳答案
在 EF Code-First CTP5 中,您可以使用 [NotMapped]
注释。
using System.ComponentModel.DataAnnotations;
public class Song
{
public int Id { get; set; }
public string Title { get; set; }
[NotMapped]
public int Track { get; set; }
关于c# - 如何不首先保留属性 EF4 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3595404/