예제 #1
0
 public IHttpActionResult Post([FromBody] RoomModel model)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState));
         }
         var response = roomHandler.Add(model);
         if (response.Id == 0)
         {
             return(Ok("Something went wrong"));
         }
         else
         {
             return(Ok("Room created"));
         }
     }
     catch (Exception)
     {
         return(Ok("Something went wrong"));
     }
 }