Open rfpedrosa opened 3 years ago
I also have a use case for this that relates to table sharing. I've found that I need to call HasColumnName
for two entities to share a table's column. It would be nice if there was a public method for this plugin that would convert our name to the convention we choose on DbContextOptionsBuilder<TContext>
when we have to use HasColumnName
. For example .HasColumnName(RewriteName(nameof(Entity.PropertyName))
Sometimes, I end up defining how things should be named in the DB. For example:
.UseHiLo($"{nameof(MyClass).ToSnakeCase()}_hilo")
I end up writing my own string extension to have consistent snake case naming but, ideally, I would reuse SnakeCaseNameRewriter: