logo
  • 教程列表
  • SO官方文档
  • Code First DataAnnotations
    • 列属性
    • 必需属性
    • MaxLength 和 MinLength 属性
    • DatabaseGenerated 属性
    • ForeignKey(字符串)属性
    • InverseProperty(字符串)属性
    • ComplexType 属性
    • 关键属性
    • 范围(minmax)属性
    • NotMapped 属性
    • 表属性
    • 索引属性
    • StringLength(int) 属性
    • 时间戳属性
    • ConcurrencyCheck 属性
  1. StackOverflow 文档
  2. Entity Framework 教程
  3. Code First DataAnnotations
  4. 表属性

表属性

Created: November-22, 2018

[Table("People")]
public class Person
{
    public int PersonID { get; set; }
    public string PersonName { get; set; }    
}

告诉实体框架使用特定的表名而不是生成一个(即 Person 或 Persons)

我们还可以使用[Table]属性为表指定模式

[Table("People", Schema = "domain")]
  • 索引属性
  • NotMapped 属性

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明