Update dynamic-csharp-api-clients document

pull/3877/head
liangshiwei 5 years ago
parent 7ff494b963
commit cdd4e597f8

@ -39,7 +39,7 @@ Now, it's ready to create the client proxies. Example:
````csharp
[DependsOn(
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
{
@ -47,7 +47,7 @@ public class MyClientAppModule : AbpModule
{
//Create dynamic client proxies
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
context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly,
remoteServiceName: "BookStore"
typeof(BookStoreApplicationContractsModule).Assembly,
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
@ -155,7 +155,7 @@ When you create a service proxy for `IBookAppService`, you can directly inject t
````csharp
context.Services.AddHttpClientProxies(
typeof(BookStoreApplicationModule).Assembly,
typeof(BookStoreApplicationContractsModule).Assembly,
asDefaultServices: false
);
````

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

Loading…
Cancel
Save