示例#1
0
        public async Task <AppointmentProjection> CreateAppointment(AppointmentProjection appointment)
        {
            try
            {
                if (appointment != null)
                {
                    var appointmentEntity = _mapper.Map <Appointment>(appointment);
                    await _appointmentDataService.CreateAppointment(appointmentEntity);
                }
            }
            catch (Exception ex)
            {
                Trace.Write(ex.Message, nameof(CreateAppointment));
            }

            return(appointment);
        }
        public async Task <IHttpActionResult> CreateAppointment(AppointmentProjection appointment)
        {
            var createdAppointment = await _appointmentService.CreateAppointment(appointment);

            return(Ok(appointment));
        }