Ejemplo n.º 1
0
 public static IActionResult ToActionResult(this CommandResult result) => result.ToActionResult(() => new OkObjectResult(result));
Ejemplo n.º 2
0
 public static IActionResult ToActionResult <T>(this CommandResult <T> result, Func <CommandResult <T>, IActionResult> onSuccess)
 {
     return(result.IsFailure
         ? new BadRequestObjectResult(result)
         : onSuccess(result));
 }