更新时间:2023-02-14 21:06:07
你已经很近了这是代码。
You got close. Here's the code.
foreach (var property in modelBuilder.Model.GetEntityTypes()
.SelectMany(t => t.GetProperties())
.Where(p => p.ClrType == typeof(decimal)))
{
property.Relational().ColumnType = "decimal(18, 6)";
}