コード例 #1
0
ファイル: PlayerController.cs プロジェクト: granhal/fxs
 public async Task <IActionResult> AddOneAsync(PlayerRequestModel playerRequestModel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             return(Ok(await _services.AddOne(playerRequestModel)));
         }
         throw new FXSException("Model is invalid", "401");
     }
     catch (FXSException fxse)
     {
         return(StatusCode(Int32.Parse(fxse.Code), new ExceptionModel {
             Message = fxse.Message, Code = fxse.Code
         }));
     }
     catch (Exception ex)
     {
         return(NotFound(ex.Message));
     }
 }