/// <summary> /// post method for inserting a new apartment /// </summary> /// <param name="newApartmentDto"></param> /// <returns></returns> public async Task <HttpResponseMessage> Post([FromBody] ApartmentDto newApartmentDto) { try { newApartmentDto.ActiveBit = true; newApartmentDto.CurrentCapacity = 0; if (await logicHelper.AddApartment(newApartmentDto)) { var Response1 = Request.CreateResponse(HttpStatusCode.OK, "successful insert"); log.Info("Apartment Post Successful"); return(Response1); } var Response2 = Request.CreateResponse(HttpStatusCode.BadRequest, "failed to insert"); log.Info("Apartment Post Unsuccessful"); return(Response2); } catch (Exception ex) { LogHelper.SendError(log, ex); return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }