/// <inheritdoc /> public async Task <GetAllEnumerationValuesResponse> GetAllEnumerationValuesAsync(CancellationToken cancellationToken) { const string cacheKeyName = "__AllEnumerations"; GetAllEnumerationValuesResponse toReturn = null; this.loggerWrapper.Debug( $"Pulling back {nameof(AllEnumerationValuesResult)} from the " + $"{nameof(ICacheManager)}..."); object unboxedEnumerationValuesResult = await this.cacheManager.GetAsync(cacheKeyName, cancellationToken) .ConfigureAwait(false); AllEnumerationValuesResult enumerationValuesResult = unboxedEnumerationValuesResult as AllEnumerationValuesResult; // Result will be non-null. this.loggerWrapper.Info( $"{nameof(AllEnumerationValuesResult)} pulled back from the " + $"{nameof(ICacheManager)}: {enumerationValuesResult}."); toReturn = new GetAllEnumerationValuesResponse() { Enumerations = enumerationValuesResult.Enumerations, }; return(toReturn); }
/// <inheritdoc /> public async Task <object> InitialiseCacheItemAsync(string key, CancellationToken cancellationToken) { object toReturn = null; this.loggerWrapper.Debug( $"Looking up all enumeration values from storage with " + $"name \"{key}\"..."); AllEnumerationValuesResult allEnumerationsResult = await this.allEnumerationValuesResultStorageAdapter.GetAllEnumerationValuesResultAsync( cancellationToken) .ConfigureAwait(false); this.loggerWrapper.Info( $"Pulled {allEnumerationsResult} from storage for {key}."); toReturn = allEnumerationsResult; return(toReturn); }