ServiceProxyFactory.CreateServiceProxy<TServiceInterface> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a proxy to communicate to the specified service using the remoted interface TServiceInterface that the service implements.
public TServiceInterface CreateServiceProxy<TServiceInterface> (Uri serviceUri, Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partitionKey = default, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector targetReplicaSelector = Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector.PrimaryReplica, string listenerName = default) where TServiceInterface : Microsoft.ServiceFabric.Services.Remoting.IService;
abstract member CreateServiceProxy : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string -> 'ServiceInterface (requires 'ServiceInterface :> Microsoft.ServiceFabric.Services.Remoting.IService)
override this.CreateServiceProxy : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string -> 'ServiceInterface (requires 'ServiceInterface :> Microsoft.ServiceFabric.Services.Remoting.IService)
Public Function CreateServiceProxy(Of TServiceInterface As IService) (serviceUri As Uri, Optional partitionKey As ServicePartitionKey = Nothing, Optional targetReplicaSelector As TargetReplicaSelector = Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector.PrimaryReplica, Optional listenerName As String = Nothing) As TServiceInterface
Type Parameters
- TServiceInterface
Interface that is being remoted
Parameters
- serviceUri
- Uri
Uri of the Service.
- partitionKey
- ServicePartitionKey
The Partition key that determines which service partition is responsible for handling requests from this service proxy
- targetReplicaSelector
- TargetReplicaSelector
Determines which replica or instance of the service partition the client should connect to.
- listenerName
- String
This parameter is Optional if the service has a single communication listener. The endpoints from the service are of the form {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}. When the service exposes multiple endpoints, this parameter identifies which of those endpoints to use for the remoting communication.
Returns
The proxy that implement the interface that is being remoted. The returned object also implement IServiceProxy interface.
Implements
Applies to
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기