abp(ef core,core first)设置decimal字段精度

方法一:直接添加特性

[Column(TypeName = "decimal(18,2)")]
public decimal Money { get; set; }

方法二:Fluent API

dbcontext中

 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
       base.OnModelCreating(modelBuilder);
       modelBuilder.Entity<PayPay>().Property(p => p.Money).HasColumnType("decimal(18,2)");
 }

abp建议结构:

 

 

posted @ 2018-08-22 11:59  开拓丿飞  阅读(1304)  评论(0)    收藏  举报