Ejemplo n.º 1
0
 protected ResponseData <T> Execute <T>(Func <T> serviceAction)
 {
     try
     {
         return(ResponseFactory <T> .CreateSuccessResponse(serviceAction.Invoke()));
     }
     catch (BusinessException ex)
     {
         return(ResponseFactory <T> .CreateErrorResponse(ex));
     }
     catch (Exception ex)
     {
         return(ResponseFactory <T> .CreateFatalResponse(ex.ToString()));
     }
 }