コード例 #1
0
 public bool Post(Load load)
 {
     if (!ModelState.IsValid)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, "Invalid Request");
     }
     if (loadService != null)
     {
         try
         {
             var loadToSave = load.CreateFromClientToServer();
             if (loadService.SaveLoad(loadToSave))
             {
                 return(true);
             }
         }
         catch (Exception)
         {
             return(false);
         }
     }
     return(false);
 }
コード例 #2
0
 public IActionResult Post([FromBody] Load load)
 {
     _service.SaveLoad(load);
     return(Ok(load));
 }