Пример #1
0
        public async Task <IActionResult> PutAsync([FromRoute] int id, [FromBody] UpdateAppointmentDto updateAppointmentDto)
        {
            var updateAppointment = _mapper.Map <Appointment>(updateAppointmentDto);

            await _appointmentService.UpdateAppointmentAsync(id, updateAppointment);

            return(NoContent());
        }
Пример #2
0
        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);
        }
Пример #3
0
            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);
            }