![]() |
VOOZH | about |
dotnet add package EFCore.MigrationExtensions.PostgreSQL --version 10.0.0
NuGet\Install-Package EFCore.MigrationExtensions.PostgreSQL -Version 10.0.0
<PackageReference Include="EFCore.MigrationExtensions.PostgreSQL" Version="10.0.0" />
<PackageVersion Include="EFCore.MigrationExtensions.PostgreSQL" Version="10.0.0" />Directory.Packages.props
<PackageReference Include="EFCore.MigrationExtensions.PostgreSQL" />Project file
paket add EFCore.MigrationExtensions.PostgreSQL --version 10.0.0
#r "nuget: EFCore.MigrationExtensions.PostgreSQL, 10.0.0"
#:package EFCore.MigrationExtensions.PostgreSQL@10.0.0
#addin nuget:?package=EFCore.MigrationExtensions.PostgreSQL&version=10.0.0Install as a Cake Addin
#tool nuget:?package=EFCore.MigrationExtensions.PostgreSQL&version=10.0.0Install as a Cake Tool
Adds views, synonyms, stored procedures, etc. (so-called SQL objects) to the EF model. Creates migrations, when those objects are changed. SQL objects are defined as raw SQL in C#-code or in embedded resources. They can be even generated at runtime.
All EF Core model-tracking and application features are supported:
Database.Migrate() or Database.EnsureCreated().dotnet ef migrations script.dotnet ef database update.UseSqlObjects:
CustomNpgsqlDesignTimeServicesprotected override void OnModelCreating(ModelBuilder modelBuilder)
{
//...
// Add SqlObject directly
// Order is used to define the order in which objects are created / updated in DB
const string Sql = "create or replace view migr_ext_tests.v_view_10 as select * from migr_ext_tests.my_table;";
modelBuilder.AddSqlObjects(new SqlObject(Name: "v_view_10", SqlCode: Sql) { Order = 10 });
// Add all embedded resources, placed in assembly's "Sql" folder
// Only *.sql resources are added
// There is no way to define order for embedded objects
// Use resources' names if you need to sort objects
modelBuilder.AddSqlObjects(assembly: typeof(Class1).Assembly, folder: "Sql");
}
dotnet tool restoredotnet dotnet-ef migrations add MyMigr --context TestContext --project TestDataAccessLayer.csproj --startup-project ../TestEntryPoint/TestEntryPoint.csprojdotnet dotnet-ef database update --context TestContext --project TestDataAccessLayer.csproj --startup-project ../TestEntryPoint/TestEntryPoint.csprojdotnet dotnet-ef migrations script TestMigr Meetup1 --context TestContext --project TestDataAccessLayer.csproj --startup-project ../TestEntryPoint/TestEntryPoint.csproj| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.