Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Consider the Product and Customer class</p> <pre><code>public class Product { public int Id { get; set; } public string Name { get; set; } public int Stock { get; set; } } public class Customer { public int Id { get; set; } public string Name { get; set; } } public class MyDbContext : DbContext { public DbSet&lt;Product&gt; Product { get; set; } public DbSet&lt;Customer&gt; Customer { get; set; } public MyDbContext() { } protected override void OnModelCreating(System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder) { modelBuilder.Conventions.Remove&lt;PluralizingEntitySetNameConvention&gt;(); modelBuilder.Conventions.Add&lt;TableNameUppercaseConvention&gt;(); base.OnModelCreating(modelBuilder); } } public class TableNameUppercaseConvention : IConfigurationConvention&lt;Type, EntityTypeConfiguration&gt; { public void Apply(Type typeInfo, Func&lt;EntityTypeConfiguration&gt; configuration) { configuration().ToTable(typeInfo.Name.ToUpper()); } } </code></pre> <h2><strong>EDIT:</strong></h2> <p>I tried to do something like this, but it seems that doesn't work, idk why</p> <pre><code>public class ColumnUppercaseConvention : IConfigurationConvention&lt;MemberInfo, PrimitivePropertyConfiguration&gt; { public void Apply(MemberInfo memberInfo, Func&lt;PrimitivePropertyConfiguration&gt; configuration) { configuration().ColumnName = memberInfo.Name.ToUpper(); } } </code></pre> <p>my best approach was</p> <pre><code>public class Customer { [Column(Name = "ID")] public int Id { get; set; } [Column(Name = "NAME")] public string Name { get; set; } } </code></pre> <p>sorry, I can't help right now, but I'll keep trying.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload