public async Task <HttpResponseMessage> Delete(int id) { try { var thisData = await logicHelper.HousingDataGetAll(); var thisHousingData = thisData.Find(x => x.AssociateID == id); if (await logicHelper.DeleteHousingData(thisHousingData)) { log.Info("HousingData Delete Successful"); return(Request.CreateResponse(HttpStatusCode.OK, "successful deletion")); } log.Info("HousingData Delete Unsuccessful"); return(Request.CreateResponse(HttpStatusCode.BadRequest, "failed to delete")); } catch (Exception ex) { LogHelper.SendError(log, ex); return(Request.CreateResponse(HttpStatusCode.BadRequest, "failed to delete")); } }