dbcontext Postgresql Postgis

Postgresql gebruikt SnakeCaseNaming (hoofdletters in tabellen vervangen door _ )

SnakeCaseNaming:

Installeer Nuget package

Install-Package EFCore.NamingConventions -Version 1.0.0

PostGis:

Installeer Nuget package

Install-Package Npgsql.NetTopologySuite -Version 4.1.2

in Startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddDbContext<ApplicationDbContext>(options =>
    {
        options.UseNpgsql(Configuration.GetConnectionString("connection"), o=>o.UseNetTopologySuite());
        options.UseSnakeCaseNamingConvention();
    });
}

 

Categories: , ,

Related Article