Пример #1
0
        public async Task <ActionResult <IEnumerable <RequestReadDto> > > GetAllRequestsAsync()
        {
            try
            {
                var request = await requestsRepository.GetAllAsync();

                var mappedmodel = mapper.Map <IEnumerable <RequestReadDto> >(request);
                return(Ok(mappedmodel));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
                    Status = "Error", Message = ex.Message
                }));
            }
        }