public void RemoveBookingById(string id) { int idConverted; bool success = int.TryParse(id, out idConverted); if (success == false) { throw new WebFaultException <string>("Please input a number instead ", HttpStatusCode.BadRequest); } try { dataBaseRepository.RemoveBookingById(idConverted); } catch (Exception ex) { SaveException.Log("webErrors.txt", ex); throw new WebFaultException <string>("Sorry something went wrong when trying to delete at position " + id, HttpStatusCode.InternalServerError); } }
public void RemoveBookingById(int id) { dataBaseRepository.RemoveBookingById(id); }