1

I'm using EF6 with Oracle via ODP.NET. And I need (and I can't change it) that all db objects would be in uppercase.

I added some conventions and now I have all tables, columns, foreign keys etc in uppercase. All but Discriminator column that generated by EF for two TPH hierarchies.

My question is how I can tell EF to rename this column? I know the way with Requires(...).HasValue(...) syntax but I don't want to specify discriminator value for every type (and for every new hierarchy in future). I satisfied with default values, just want to rename column itself.

Alexey Merson
  • 414
  • 5
  • 12
  • Please see ["Should questions include “tags” in their titles?"](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles), where the consensus is "no, they should not"! –  Jan 15 '16 at 11:28

1 Answers1

0

Following convention solved my problem (found here):

public class UpperCaseDiscriminatorConvention : IStoreModelConvention<EdmProperty>
{
    public void Apply(EdmProperty property, DbModel model)
    {
        if (property.Name == "Discriminator")
        {
            property.Name = "DISCRIMINATOR";
        }
    }
}
Alexey Merson
  • 414
  • 5
  • 12