Entity Framework Core - setting the decimal precision and scale to all decimal properties [duplicate]
问题 This question already has an answer here : Loop/reflect through all properties in all EF Models to set Column Type (1 answer) Closed 2 years ago . I want to set the precision of all the decimal properties to (18,6). In EF6 this was quite easy: modelBuilder.Properties<decimal>().Configure(x => x.HasPrecision(18, 6)); but I can't seem to find anything similar to this in EF Core. Removing the cascade delete convention wasn't as simple as in EF6 so I found the following workaround: EF6: