public async Task <IActionResult> PutAsync([FromRoute] int id, [FromBody] UpdateAppointmentDto updateAppointmentDto) { var updateAppointment = _mapper.Map <Appointment>(updateAppointmentDto); await _appointmentService.UpdateAppointmentAsync(id, updateAppointment); return(NoContent()); }
public ActionResult <UpdateAppointmentDto> PutAppointment(long id, UpdateAppointmentDto appointment) { if (!ModelState.IsValid || appointment == null || id != appointment.Id || appointment.BeginTime > DateTime.Now) { return(BadRequest()); } _service.Update(appointment); return(appointment); }
public ICollection <AppointmentProcedures> Resolve(UpdateAppointmentDto source, Appointment destination, ICollection <AppointmentProcedures> destMember, ResolutionContext context) { var appointmentProcedures = new List <AppointmentProcedures>(); foreach (var procedureId in source.ProceduresIds) { var appointmentProcedure = new AppointmentProcedures { ProcedureId = procedureId }; appointmentProcedures.Add(appointmentProcedure); } return(appointmentProcedures); }