共用方式為


ServiceBrokerExtensions.CompareLocalToRemoteVersionAsync Method

Definition

Compares a locally recognized service to what is available remotely for the same service.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<int> CompareLocalToRemoteVersionAsync(Microsoft::ServiceHub::Framework::IServiceBroker ^ serviceBroker, Microsoft::ServiceHub::Framework::ServiceMoniker ^ moniker, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.ValueTask<int> CompareLocalToRemoteVersionAsync (this Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, Microsoft.ServiceHub.Framework.ServiceMoniker moniker, System.Threading.CancellationToken cancellationToken);
static member CompareLocalToRemoteVersionAsync : Microsoft.ServiceHub.Framework.IServiceBroker * Microsoft.ServiceHub.Framework.ServiceMoniker * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
<Extension()>
Public Function CompareLocalToRemoteVersionAsync (serviceBroker As IServiceBroker, moniker As ServiceMoniker, cancellationToken As CancellationToken) As ValueTask(Of Integer)

Parameters

serviceBroker
IServiceBroker

The service broker to ask for available remote versions.

moniker
ServiceMoniker

The moniker for the service whose versions are to be checked. This must have its Version property set to a non-null value in order to have something to compare to the remote service.

cancellationToken
CancellationToken

A cancellation token.

Returns

An CompareTo(T) style integer indicating how the local expectation of the service compares to the version offered by the remote. -1: the local version is older (i.e. the client should be upgraded). 0: the local and remote versions are compatible or the remote version was not available. +1: the local version is newer (i.e. the remote should be upgraded).

Applies to