在数据实体上加 Table 属性,效果如下 命名空间 using System.ComponentModel.DataAnnotations.Schema; 特别注意属性名称是 Table 一不小心会写成 TableName