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

  • 關於本站
  • 免責聲明