コード例 #1
0
 public HttpResponseMessage AddBeneficiary(BeneficiaryModel model)
 {
     try
     {
         if (!_processController.ValidateRequest(model as RequestBase))
         {
             return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new UnauthorizedAccessException("Unauthorized access. Please try to log in again.")));
         }
         var response = _processController.AddBeneficiary(model);
         return(Request.CreateResponse(HttpStatusCode.OK, response));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, ex.ToString()));
     }
 }