Browse Source

Update dynamic-csharp-api-clients document

pull/3877/head
liangshiwei 6 years ago
parent
commit
cdd4e597f8
  1. 12
      docs/en/API/Dynamic-CSharp-API-Clients.md
  2. 12
      docs/zh-Hans/API/Dynamic-CSharp-API-Clients.md

12
docs/en/API/Dynamic-CSharp-API-Clients.md

@ -39,7 +39,7 @@ Now, it's ready to create the client proxies. Example:
````csharp ````csharp
[DependsOn( [DependsOn(
typeof(AbpHttpClientModule), //used to create client proxies typeof(AbpHttpClientModule), //used to create client proxies
typeof(BookStoreApplicationModule) //contains the application service interfaces typeof(BookStoreApplicationContractsModule) //contains the application service interfaces
)] )]
public class MyClientAppModule : AbpModule public class MyClientAppModule : AbpModule
{ {
@ -47,7 +47,7 @@ public class MyClientAppModule : AbpModule
{ {
//Create dynamic client proxies //Create dynamic client proxies
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly typeof(BookStoreApplicationContractsModule).Assembly
); );
} }
} }
@ -142,12 +142,12 @@ The examples above have configured the "Default" remote service endpoint. You ma
````csharp ````csharp
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly, typeof(BookStoreApplicationContractsModule).Assembly,
remoteServiceName: "BookStore" remoteServiceConfigurationName: "BookStore"
); );
```` ````
`remoteServiceName` parameter matches the service endpoint configured via `AbpRemoteServiceOptions`. If the `BookStore` endpoint is not defined then it fallbacks to the `Default` endpoint. `remoteServiceConfigurationName` parameter matches the service endpoint configured via `AbpRemoteServiceOptions`. If the `BookStore` endpoint is not defined then it fallbacks to the `Default` endpoint.
### As Default Services ### As Default Services
@ -155,7 +155,7 @@ When you create a service proxy for `IBookAppService`, you can directly inject t
````csharp ````csharp
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly, typeof(BookStoreApplicationContractsModule).Assembly,
asDefaultServices: false asDefaultServices: false
); );
```` ````

12
docs/zh-Hans/API/Dynamic-CSharp-API-Clients.md

@ -39,7 +39,7 @@ public class MyClientAppModule : AbpModule
````csharp ````csharp
[DependsOn( [DependsOn(
typeof(AbpHttpClientModule), //用来创建客户端代理 typeof(AbpHttpClientModule), //用来创建客户端代理
typeof(BookStoreApplicationModule) //包含应用服务接口 typeof(BookStoreApplicationContractsModule) //包含应用服务接口
)] )]
public class MyClientAppModule : AbpModule public class MyClientAppModule : AbpModule
{ {
@ -47,7 +47,7 @@ public class MyClientAppModule : AbpModule
{ {
//创建动态客户端代理 //创建动态客户端代理
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly typeof(BookStoreApplicationContractsModule).Assembly
); );
} }
} }
@ -142,12 +142,12 @@ public override void ConfigureServices(ServiceConfigurationContext context)
````csharp ````csharp
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly, typeof(BookStoreApplicationContractsModule).Assembly,
remoteServiceName: "BookStore" remoteServiceConfigurationName: "BookStore"
); );
```` ````
`remoteServiceName`参数会匹配通过`AbpRemoteServiceOptions`配置的服务端点.如果`BookStore`端点没有定义就会使用默认的`Default`端点. `remoteServiceConfigurationName`参数会匹配通过`AbpRemoteServiceOptions`配置的服务端点.如果`BookStore`端点没有定义就会使用默认的`Default`端点.
### 作为默认服务 ### 作为默认服务
@ -155,7 +155,7 @@ context.Services.AddHttpClientProxies(
````csharp ````csharp
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly, typeof(BookStoreApplicationContractsModule).Assembly,
asDefaultServices: false asDefaultServices: false
); );
```` ````

Loading…
Cancel
Save