public Task<VersionLoginClient> GetWithCachedVersionAsync(LoginClient client) { if (this._version == null) { return client.WithAutomaticVersionAsync().Then(task => { this._version = task.Result.Version; return task; }).ToSafeTask(); } var tcs = new TaskCompletionSource<VersionLoginClient>(); tcs.SetResult(client.WithVersion(this._version.Value)); return tcs.Task; }
public Task <VersionLoginClient> GetWithCachedVersionAsync(LoginClient client) { if (this._version == null) { return(client.WithAutomaticVersionAsync().Then(task => { this._version = task.Result.Version; return task; }).ToSafeTask()); } var tcs = new TaskCompletionSource <VersionLoginClient>(); tcs.SetResult(client.WithVersion(this._version.Value)); return(tcs.Task); }
public static VersionLoginClient WithAutomaticVersion(this LoginClient client) { return(client.WithAutomaticVersionAsync().GetResultEx()); }