public async Task <ModulePermission.SaveResult> SaveAsync(ModulePermission.SaveModel model, CancellationToken cancellationToken = default) { var cacheKey = _cacheHelper.CreateKey <ModulePermission.SaveModel, ModulePermission.SaveResult>(model); if (TryGetFromCache(cacheKey, out ModulePermission.SaveResult result)) { return(result); } using var process = GetProcess <ISaveModulePermission>(); process.Model = model; return(TrySaveToCache(cacheKey, await process.ExecuteAsync(cancellationToken), _configuration.CacheExpiration.Permission.Save)); }
public Task <ModulePermission.SaveResult> SaveAsync(ModulePermission.SaveModel model, CancellationToken cancellationToken = default) { using var process = GetProcess <ISaveModulePermission>(); process.Model = model; return(process.ExecuteAsync(cancellationToken)); }