可以通过NotMappedAttribute标记模型某个属性可以使该属性不必映射到数据库. public class Unicorn { public int Id { get; set; } [NotMapped] public string Name { get; set; } [Timestamp] public byte[] Version { get; set; } public int PrincessId { get; set; } // FK for Princess refer…