public async Task <ActionResult> UpdateAppointmentStatusAsync(int appointmentId, int statusId) { if (!await _service.AppointmentExists(appointmentId)) { return(BadRequest("Appointment not Found")); } else if (statusId < 1 || statusId > 3) { return(BadRequest("Invalid appointment status")); } await _service.UpdateAppointmentStatusAsync(appointmentId, statusId); return(Ok("Update OK")); }