コード例 #1
0
 public async Task <IHttpActionResult> Post(OrderComment comment)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _repo.AddOrderComment(comment);
             if (await _repo.SaveChangesAsync())
             {
                 return(Created("", comment));
             }
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
     return(BadRequest());
 }