Compartilhar via


StoreServicesExperimentVariation.GetCachedVariationAsync(String) Method

Definition

Retrieves the current locally cached variation assignment for the specified experiment.

public:
 static IAsyncOperation<StoreServicesExperimentVariationResult ^> ^ GetCachedVariationAsync(Platform::String ^ experimentProjectId);
 static IAsyncOperation<StoreServicesExperimentVariationResult> GetCachedVariationAsync(winrt::hstring const& experimentProjectId);
public static IAsyncOperation<StoreServicesExperimentVariationResult> GetCachedVariationAsync(string experimentProjectId);
function getCachedVariationAsync(experimentProjectId)
Public Shared Function GetCachedVariationAsync (experimentProjectId As String) As IAsyncOperation(Of StoreServicesExperimentVariationResult)

Parameters

experimentProjectId
String

Platform::String

winrt::hstring

The project ID of the experiment for which you want to retrieve the locally cached variation assignment.

Returns

A StoreServicesExperimentVariationResult that represents the result of the asynchronous operation. This object provides access to the locally cached variation assignment.

Remarks

This method retrieves the locally cached variation assignment for the experiment that is associated with the specified project ID.

When you retrieve an experiment variation in your app, we recommend that you first call GetCachedVariationAsync to get the locally cached variation assignment. Before using the variation assignment, use the IsStale property to determine whether there is an updated variation assignment available from the server. If there is, then call the GetRefreshedVariationAsync method to get the latest variation assignment.

For a code example that demonstrates how to use this method, see Code your experiment in your app.

Applies to

See also