public TOutput Execute(TParam param) { Logger.LogInformation($"Executing command with parameter of type {param.GetType()}"); var result = Decoratee.Execute(param); return(result); }
public EitherAsync <Error, TResponse> Execute(TParam param) { var logger = Log.ForContext(RootInstance.GetType()); logger.Debug("Executing query {@QueryParam}", param); var result = Decoratee.Execute(param) .Do(_ => logger.Debug("Query execution complete.")); return(result); }
public TOutput Execute(TParam param) { TOutput result; try { result = Decoratee.Execute(param); } catch (Exception ex) { Logger.LogError("Exception has occured: {ex}", ex); throw; } return(result); }
public TOutput Execute(TParam param) { var key = CacheService.GetKey(param); TOutput result; if (CacheService.Has(key)) { result = CacheService.Get <TOutput>(key); } else { result = Decoratee.Execute(param); if (result is not null) { CacheService.Set(key, result); } } return(result); }