public IActionResult Post([FromBody] AppointmentItemsForTB appointment) { using (var scope = new TransactionScope()) { _appointmentRepository.InsertAppointment(appointment); scope.Complete(); return(CreatedAtAction(nameof(Get), new { id = appointment.Appointment_ID }, appointment)); } }
public IActionResult Put([FromBody] AppointmentItemsForTB appointment) { if (appointment != null) { using (var scope = new TransactionScope()) { _appointmentRepository.UpdateAppointment(appointment); scope.Complete(); return(new OkResult()); } } return(new NoContentResult()); }
public void UpdateAppointment(AppointmentItemsForTB appointment) { dbContext.Entry(appointment).State = EntityState.Modified; Save(); }
public void InsertAppointment(AppointmentItemsForTB APPOINTMENT_TB) { dbContext.APPOINTMENT_TB.Add(APPOINTMENT_TB); dbContext.SaveChanges(); }