我想知道有没有办法从数据库中排除某些字段?例如:
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string FatherName { get; set; }
public bool IsMale { get; set; }
public bool IsMarried { get; set; }
public string AddressAs { get; set; }
}
如何从数据库中排除 AddressAs 字段?
供将来参考:您可以使用数据注释MSDN EF - 代码优先数据注释 https://msdn.microsoft.com/en-us/data/jj591583.aspx#NotMapped
[NotMapped]
public string AddressAs { get; set; }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)