摘要: 一、通过Attribute配置约束 主键约束 通过KeyAttribute来配置主键约束,代码如下: [Key] public int PrimaryKey{ get; set; } 外键约束 通过ForeignKeyAttribute来配置外键约束,代码如下: [Key] public int P 阅读全文
posted @ 2022-08-10 19:26 搭车去柏林 阅读(118) 评论(0) 推荐(1)
摘要: HasColumnType HasColumnType是指定字段类型 [Column(TypeName = "decimal(18, 2)")] public decimal Money { get; set; } 等同于 builder.Property(a => a.Money).HasColu 阅读全文
posted @ 2022-08-10 19:14 搭车去柏林 阅读(555) 评论(0) 推荐(0)