Пример #1
0
 public HttpResponseMessage AddBuilding(Building b)
 {
     try
     {
         int buildingId = BuildingBL.AddBuilding(b);
         return(Request.CreateResponse(HttpStatusCode.OK, buildingId));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex));
     }
 }
 public IHttpActionResult Post([FromBody] Building b)
 {
     try
     {
         BuildingBL.AddBuilding(b);
         return(Ok());
     }
     catch
     {
         throw;
     }
 }