Exemplo n.º 1
0
        public async Task <ApplicationPermission.SaveResult> SaveAsync(ApplicationPermission.SaveModel model, CancellationToken cancellationToken = default)
        {
            var cacheKey = _cacheHelper.CreateKey <ApplicationPermission.SaveModel, ApplicationPermission.SaveResult>(model);

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

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