Browse Source

Updated: more concise instructions to change BookStoreEntityFrameworkCoreModule

pull/1689/head
Dillan Cagnetta 7 years ago
parent
commit
6b98e535dd
  1. 34
      docs/en/Best-Practices/PostgreSQL-Integration.md

34
docs/en/Best-Practices/PostgreSQL-Integration.md

@ -5,36 +5,10 @@
### EntityFrameworkCore Project Update
- In `Acme.BookStore.EntityFrameworkCore` project replace package `Volo.Abp.EntityFrameworkCore.SqlServer` with `Volo.Abp.EntityFrameworkCore.PostgreSql`
- Update to use PostgreSQL in `BookStoreEntityFrameworkCoreModule`. Example:
````C#
[DependsOn(
//code omitted for brevity
/* This was updated from AbpEntityFrameworkCoreSqlServerModule */
typeof(AbpEntityFrameworkCorePostgreSqlModule),
/* This was updated from AbpEntityFrameworkCoreSqlServerModule */
//code omitted for brevity
)]
public class Acme.BookStore.EntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<BookStoreDbContext>(options =>
{
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
/* This was updated */
options.UsePostgreSql();
/* This was updated */
});
}
}
````
- Update to use PostgreSQL in `BookStoreEntityFrameworkCoreModule`.
1. **Do** Replace the `AbpEntityFrameworkCoreSqlServerModule` with the `AbpEntityFrameworkCorePostgreSqlModule`
2. **Do** Replace the `options.UseSqlServer()` with the `options.UsePostgreSql()`
### Update Connection String Settings
- **Do** Update the PostgreSQL connection string in all `appsettings.json` files.

Loading…
Cancel
Save