Skip to content

Commit

Permalink
docs(Isolation): Fix Isolation documentation errors (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenlei520 authored Apr 8, 2022
1 parent a024d11 commit 2ece5c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[](README.zh-CN.md) | EN

## Masa.Contrib.Isolation.Environment
## Masa.Contrib.Isolation.MultiEnvironment

Example:

```C#
Install-Package Masa.Contrib.Isolation.UoW.EF
Install-Package Masa.Contrib.Isolation.Environment
Install-Package Masa.Contrib.Isolation.MultiEnvironment
Install-Package Masa.Utils.Data.EntityFrameworkCore.SqlServer
```

Expand Down Expand Up @@ -63,7 +63,7 @@ You can also choose not to implement IMultiEnvironment when using physical isola
* The environment provides 7 parsers by default, and the execution order is: HttpContextItemParserProvider、 QueryStringParserProvider、 FormParserProvider、 RouteParserProvider、 HeaderParserProvider、 CookieParserProvider、 EnvironmentVariablesParserProvider (Get the parameters in the system environment variables, the parameters of the default environment isolation: ASPNETCORE_ENVIRONMENT)
* HttpContextItemParserProvider: Get tenant information through the Items property of the requested HttpContext
* QueryStringParserProvider: Get environment information through the requested QueryString
* https://github.com/masastack?ASPNETCORE_ENVIRONMENT=dev (environment information is dev)
* https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (environment information is development)
* FormParserProvider: Get environment information through Form form
* RouteParserProvider: Get environment information through routing
* HeaderParserProvider: Get environment information through request headers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
中 | [EN](README.md)

## Masa.Contrib.Isolation.Environment
## Masa.Contrib.Isolation.MultiEnvironment

用例:

```C#
Install-Package Masa.Contrib.Isolation.UoW.EF
Install-Package Masa.Contrib.Isolation.Environment
Install-Package Masa.Contrib.Isolation.MultiEnvironment
Install-Package Masa.Utils.Data.EntityFrameworkCore.SqlServer
```

Expand Down Expand Up @@ -64,7 +64,7 @@ public class CustomDbContext : IsolationDbContext
* 环境默认提供了7个解析器,执行顺序为:HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider、EnvironmentVariablesParserProvider (获取系统环境变量中的参数,默认环境隔离的参数:ASPNETCORE_ENVIRONMENT)
* HttpContextItemParserProvider: 通过请求的HttpContext的Items属性获取租户信息
* QueryStringParserProvider: 通过请求的QueryString获取环境信息
* https://github.com/masastack?ASPNETCORE_ENVIRONMENT=dev (环境信息是dev)
* https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (环境信息是development)
* FormParserProvider: 通过Form表单获取环境信息
* RouteParserProvider: 通过路由获取环境信息
* HeaderParserProvider: 通过请求头获取环境信息
Expand Down
4 changes: 2 additions & 2 deletions src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Example:

```C#
Install-Package Masa.Contrib.Isolation.UoW.EF
Install-Package Masa.Contrib.Isolation.Environment // Environmental isolation Quote on demand
Install-Package Masa.Contrib.Isolation.MultiEnvironment // Environmental isolation Quote on demand
Install-Package Masa.Contrib.Isolation.MultiTenant // Multi-tenant isolation On-demand reference
Install-Package Masa.Utils.Data.EntityFrameworkCore.SqlServer
```
Expand Down Expand Up @@ -67,7 +67,7 @@ Tenant isolation implements IMultiTenant, and environment isolation implements I

##### Summarize
* How many kinds of parser are currently supported?
* Currently two kinds of parsers are supported, one is [Environment Parser](../Masa.Contrib.Isolation.Environment/README.md), the other is [Tenant Parser](../Masa.Contrib.Isolation.MultiTenant/README.md)
* Currently two kinds of parsers are supported, one is [Environment Parser](../Masa.Contrib.Isolation.MultiEnvironment/README.md), the other is [Tenant Parser](../Masa.Contrib.Isolation.MultiTenant/README.md)
* How is the parser used?
* After publishing events through EventBus, EventBus will automatically call the parser middleware to trigger the environment and tenant parser to parse and assign values according to the isolation usage
* For scenarios where EventBus is not used, `app.UseIsolation();` needs to be added to Program.cs. After the request is initiated, it will first pass through the AspNetCore middleware provided by Isolation, and trigger the environment and tenant resolvers to parse and assign values. When the request arrives at the specified controller or Minimal method, the parsing is complete
Expand Down
4 changes: 2 additions & 2 deletions src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```C#
Install-Package Masa.Contrib.Isolation.UoW.EF
Install-Package Masa.Contrib.Isolation.Environment // 环境隔离 按需引用
Install-Package Masa.Contrib.Isolation.MultiEnvironment // 环境隔离 按需引用
Install-Package Masa.Contrib.Isolation.MultiTenant // 多租户隔离 按需引用
Install-Package Masa.Utils.Data.EntityFrameworkCore.SqlServer
```
Expand Down Expand Up @@ -67,7 +67,7 @@ public class CustomDbContext : IsolationDbContext

##### 总结
* 解析器目前支持几种?
* 目前支持两种解析器,一个是[环境解析器](../Masa.Contrib.Isolation.Environment/README.zh-CN.md)、一个是[租户解析器](../Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md)
* 目前支持两种解析器,一个是[环境解析器](../Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md)、一个是[租户解析器](../Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md)
* 解析器如何使用?
* 通过EventBus发布事件后,EventBus会自动调用解析器中间件,根据隔离性使用情况触发环境、租户解析器进行解析并赋值
* 针对未使用EventBus的场景,需要在Program.cs中添加`app.UseIsolation();`,在请求发起后会先经过Isolation提供的AspNetCore中间件,并触发环境、租户解析器进行解析并赋值,当请求到达指定的控制器或者Minimal的方法时已经解析完成
Expand Down

0 comments on commit 2ece5c7

Please sign in to comment.