public async Task <CustomAttributeTypedArgument> GetAttribute( string objectKey, string propertyKey, string customAttributeKey, CancellationToken token) { var typeDictionary = await CacheFacade .GetData( CacheAttribute, objectKey, token).ConfigureAwait(false); DictionaryValidation(typeDictionary, nameof(GetDictionaryAttribute)); var attributeDictionary = await CacheFacade .GetData( typeDictionary, propertyKey, token).ConfigureAwait(false); DictionaryValidation(attributeDictionary, nameof(GetDictionaryAttribute)); var result = await CacheFacade .GetData( attributeDictionary, customAttributeKey, token).ConfigureAwait(false); return(result); }
public async Task <IDictionary <string, Action <object, object> > > GetDictionaryMethodSet( string objectKey, CancellationToken token) { var dictionary = await CacheFacade.GetData(CacheSet, objectKey, token).ConfigureAwait(false); return(dictionary); }
public EngineFacade() { APIEngineCache = new CacheFacade(); (APIEngineCache as CacheFacade).SinglePostcodeServiceCallback = SinglePostcodeInformation; (APIEngineCache as CacheFacade).MultiPostcodeServiceCallback = MultiPostcodeInformation; SupplierResourceName = "postcodes"; }
public async Task <IDictionary <string, Dictionary <string, CustomAttributeTypedArgument> > > GetDictionaryAttribute( string objectKey, CancellationToken token) { var result = await CacheFacade.GetData(CacheAttribute, objectKey, token). ConfigureAwait(false); return(result); }
public async Task <IDictionary <string, PropertyInfo> > GetDictionaryProperties( string objectKey, CancellationToken token) { var result = await CacheFacade. GetData(CacheProperties, objectKey, token). ConfigureAwait(false); return(result); }
public async Task <PropertyInfo> GetProperty( string objectKey, string propertyKey, CancellationToken token) { var dictionary = await CacheFacade. GetData(CacheProperties, objectKey, token); DictionaryValidation(dictionary, nameof(GetProperty)); var result = await CacheFacade. GetData(dictionary, propertyKey, token). ConfigureAwait(false); return(result); }
public async Task AddProperty <TValue>( CancellationToken token) { await CacheFacade.RunActionInSemaphore(() => { var values = GetValues <TValue>(); var valid = CacheProperties.ContainsKey(values.typeName); if (valid || !values.isCacheable) { return; } CacheProperties.Add(values.typeName, values.properties.ToDictionary(p => p.Name, p => p)); }, token).ConfigureAwait(false); }
public async Task <Action <object, object> > GetMethodSet( string objectKey, string propertyKey, CancellationToken token) { var setMethodDictionary = await CacheFacade. GetData(CacheSet, objectKey, token). ConfigureAwait(false); DictionaryValidation(setMethodDictionary, nameof(GetMethodSet)); var result = await CacheFacade. GetData(setMethodDictionary, propertyKey, token). ConfigureAwait(false); return(result); }
public async Task AddGet <TValue>( CancellationToken token) { await CacheFacade.RunActionInSemaphore(() => { var values = GetValues <TValue>(); var valid = CacheGet.ContainsKey(values.typeName); if (valid || !values.isCacheable) { return; } var dictionary = values.properties. ToDictionary(g => g.Name, m => CacheFacade.CreateFunction <TValue>(m)); CacheGet.Add(values.typeName, dictionary); }, token).ConfigureAwait(false); }
public async Task AddSet <TValue>( CancellationToken token) { await CacheFacade.RunActionInSemaphore(() => { var(typeName, properties, isCacheable) = GetValues <TValue>(); var valid = CacheSet.ContainsKey(typeName); if (valid || !isCacheable) { return; } var dictionary = properties. ToDictionary(s => s.Name, m => CacheFacade.CreateAction <TValue>(m)); CacheSet.Add(typeName, dictionary); }, token).ConfigureAwait(false); }
public async Task AddAttribute <TValue>( CancellationToken token) { await CacheFacade.RunActionInSemaphore(() => { var values = GetValues <TValue>(); var valid = CacheAttribute.ContainsKey(values.typeName); if (valid || !values.isCacheable) { return; } var dictionary = new Dictionary <string, Dictionary <string, CustomAttributeTypedArgument> >(values.properties.Count()); CacheAttribute.Add(values.typeName, dictionary); foreach (var property in values.properties) { SetCacheAttributes(property, values.typeName); } }, token).ConfigureAwait(false); }