Exemplo n.º 1
0
 protected async Task <CommandResult> ExecuteCommandAsync <TCommand>(
     ICommandRepository <TCommand> repository, TCommand command)
     where TCommand : Command
 {
     try
     {
         await repository.ExecuteAsync(command);
     }
     catch (Exception ex)
     {
         Logger.Error(ex, $"Unhandled exception: {ex.Message}");
         return(new CommandResult(command, false).Fatal($"Unhandled exception: {ex.Message}", ex));
     }
     return(new CommandResult(command));
 }