.net core entity framework (EF Core) table naming convention plural to single/simple/underscore
Being a fan of single simple underscore
naming convention to table names, I feel uncomfortable with the way EF core is naming tables Plural PascalCase
.
Model
public class SourceType {
...
DbContext
public class ApplicationDbContext : DbContext {
public DbSet<SourceType> SourceTypes { get; set; }
...
This creates the table with the name SourceTypes
(PascalCase and Plural)
I know I can change the generated table name by using [table('source_type')]
in the model class.
But, what I need is a method to do it in global manner.