Freigeben über


ServiceProxy.Create<TServiceInterface> Methode

Definition

Erstellt einen Proxy für die Kommunikation mit dem angegebenen Dienst mithilfe der Remoteschnittstelle TServiceInterface, die der Dienst implementiert.

public static TServiceInterface Create<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;
static member Create : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector * string -> 'ServiceInterface (requires 'ServiceInterface :> Microsoft.ServiceFabric.Services.Remoting.IService)
Public Shared Function Create(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

Typparameter

TServiceInterface

Schnittstelle, die remotediert wird

Parameter

serviceUri
Uri

URI des Diensts.

partitionKey
ServicePartitionKey

Der Partitionsschlüssel, der bestimmt, welche Dienstpartition für die Verarbeitung von Anforderungen von diesem Dienstproxy verantwortlich ist

targetReplicaSelector
TargetReplicaSelector

Bestimmt, mit welchem Replikat oder instance der Dienstpartition der Client eine Verbindung herstellen soll.

listenerName
String

Dieser Parameter ist Optional, wenn der Dienst über einen einzelnen Kommunikationslistener verfügt. Die Endpunkte des Diensts haben die Form {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}. Wenn der Dienst mehrere Endpunkte verfügbar macht, identifiziert dieser Parameter, welcher dieser Endpunkte für die Remotingkommunikation verwendet werden soll.

Gibt zurück

TServiceInterface

Der Proxy, der die Schnittstelle implementiert, die remotediert wird. Das zurückgegebene Objekt implementiert IServiceProxy auch eine Schnittstelle.

Gilt für: