Browse Source

Merge pull request #22267 from abpframework/auto-merge/rel-9-0/3511

Merge branch rel-9.1 with rel-9.0
pull/22268/head
maliming 11 months ago
committed by GitHub
parent
commit
cd6562c1e6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 18
      docs/en/guides/microservice-mongodb.md

18
docs/en/guides/microservice-mongodb.md

@ -1,12 +1,12 @@
# Change Microservice project to use MongoDB Provider
This guide explains how to change Microservice project to use MongoDB as the database provider.
This guide explains how to change the Microservice project to use MongoDB as the database provider.
## Create a new Microservice project
Use the ABP Suite to create a new Microservice project, in this guide we use `BookStore` as project name.
> You can use [ABP Studio](../studio/index.md) to create a new Microservice project. In this guide, we assume that you have already created a microservice solution and used `BookStore` as your project name.
You will get the solution as shown below:
Currently, your microservice solution should be similar to that in the figure below:
![microservce-mongodb-project](../images/microservice-mongodb.png)
@ -16,9 +16,9 @@ You need to replace all EF Core references with MongoDB and update module depend
Example:
* Remove `Volo.Abp.EntityFrameworkCore.SqlServer` Nuget package reference.
* Remove `Microsoft.EntityFrameworkCore.Tools` Nuget package reference
* Remove `AbpEntityFrameworkCoreSqlServerModule` depend.
* Remove `Volo.Abp.EntityFrameworkCore.SqlServer` NuGet package reference. (instead use `Volo.Abp.MongoDB` NuGet package and also add the relevant depends on statement)
* Remove `Microsoft.EntityFrameworkCore.Tools` NuGet package reference.
* Remove `AbpEntityFrameworkCoreSqlServerModule` dependency.
* Replace `Volo.Abp.PermissionManagement.EntityFrameworkCore` with `Volo.Abp.PermissionManagement.MongoDB`.
* Update `AbpPermissionManagementEntityFrameworkCoreModule` to `AbpPermissionManagementMongoDbModule`.
@ -43,9 +43,9 @@ Here we use `BookStore.ProductService` project as an example:
protected override void CreateModel(IMongoModelBuilder modelBuilder)
{
modelBuilder.Entity<Product>(b =>
{
b.CollectionName = ProductServiceDbProperties.DbTablePrefix + "Products";
});
{
b.CollectionName = ProductServiceDbProperties.DbTablePrefix + "Products";
});
}
}
```

Loading…
Cancel
Save