public async Task <Platform.SaveResult> SaveAsync(Platform.SaveModel model, CancellationToken cancellationToken = default)
        {
            var cacheKey = _cacheHelper.CreateKey <Platform.SaveModel, Platform.SaveResult>(model);

            if (TryGetFromCache(cacheKey, out Platform.SaveResult result))
            {
                return(result);
            }

            using var process = GetProcess <ISavePlatform>();
            process.Model     = model;
            return(TrySaveToCache(cacheKey, await process.ExecuteAsync(cancellationToken), _configuration.CacheExpiration.Platform.Save));
        }
Esempio n. 2
0
 public Task <Platform.SaveResult> SaveAsync(Platform.SaveModel model, CancellationToken cancellationToken = default)
 {
     using var process = GetProcess <ISavePlatform>();
     process.Model     = model;
     return(process.ExecuteAsync(cancellationToken));
 }