Skip to content

Extensions for EnitityFramework 6.x

License

Notifications You must be signed in to change notification settings

aberus/ef6.extensions

Repository files navigation

EntityFramework.Conventions

Conventions for EnitityFramework 6.x

using System.Data.Entity;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;

public class BlogContext : DbContext  
{  
    public DbSet<Post> Posts { get; set; }  
    public DbSet<Comment> Comments { get; set; }  
    
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        modelBuilder.Conventions.Add<SnakeCaseStoreModelConvention>();
        modelBuilder.Conventions.Add<LowerCaseTableNameConvention>();
        modelBuilder.Conventions.Add<SnakeCaseColumnNameConvention>();
    }
}

Releases

No releases published

Packages

No packages published

Languages