Esempio n. 1
0
        public async Task <IActionResult> Find([FromBody] int appointmentId)
        {
            m_Logger.Information($"{nameof(Find)} Invoked");
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                AppointmentDto response = await m_AppointmentManager.GetAppointmentAsync(appointmentId).ConfigureAwait(false);

                var responseDto = m_Mapper.Map <AppointmentResponseDto>(response);
                if (responseDto != null)
                {
                    return(Ok(responseDto));
                }
            }
            catch (Exception ex)
            {
                m_Logger.Error(ex, "Error caught in the controller class.");
            }
            return(BadRequest(HttpStatusCode.BadRequest));
        }