Search code examples
c#oracle-databaseentity-framework-6dbmigrate

How to use ef6.0 to migrate the database to Oracle database fields that are generated in Upper


I used ef6.0 to migrate the database to Oracle, how to build a database field in Upper


Solution

  • I saw the other question: Configure Entity Framework v6 Code-First Identifiers to use ALL CAPS and I find the answer ,

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
    
        modelBuilder.Properties()
           .Configure(c => c.HasColumnName(c.ClrPropertyInfo.Name.ToUpperInvariant()));
        modelBuilder.Types()
           .Configure(c => c.ToTable(c.ClrType.Name.ToUpperInvariant()));            
    }
    

    I wish could help other people in need.