// POST: api/LunchReservations public HttpResponseMessage Post(LunchReservation lunchReservation) { try { var dateWithStudentResult = _lunchReservationService.GetByDateWithStudent(lunchReservation.ReservationDate, lunchReservation.StudentId); if (dateWithStudentResult != null) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Kullanıcıya ait Aynı tarihli Rezervasyon bulunuyor.")); } var result = _lunchReservationService.Add(lunchReservation); return(Request.CreateResponse(HttpStatusCode.Created, result)); } catch (Exception) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Eklenemedi")); } }
public LunchReservation Update(LunchReservation foodReservation) { return(_lunchReservationDal.Update(foodReservation)); }
public LunchReservation Add(LunchReservation foodReservation) { return(_lunchReservationDal.Add(foodReservation)); }