Muscipular/EFCoreMigrationWithComment

add efcore migrations add comment to database

★ 0Forks 2C#GitHub ↗Compare

README

EFCoreMigrationWithComment.SqlServer

add ef core 2.x migrations comment to sqlserver

usage

just modify DbContext like below, xml comment or DescriptionAttrite will add MS_Description property in database.

class MyDBContext : DbContext 
{
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        /* create model code */
        modelBuilder.ApplyComment();
    }
    
    protected override void OnConfiguring(DbContextOptionsBuilder builder)
    {
        /* another config code */
        builder.ReplaceService<IMigrationsModelDiffer, MigrationsModelDifferWithComment>();
        builder.ReplaceService<ICSharpMigrationOperationGenerator, CSharpMigrationOperationGeneratorWithComment>();
        builder.ReplaceService<IMigrationsSqlGenerator, SqlServerMigrationsSqlGeneratorWithComment>();        
    }
}

Contributors

Muscipular

Issues