コード例 #1
0
        public async Task <ActionResult> GetAllSquads()
        {
            try
            {
                var result = await _squadRepository.GetAllSquadsAsync();

                var resultDto = _mapper.Map <IEnumerable <SquadGetDto> >(result);
                return(Ok(resultDto));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Erorr retrieving data from the database"));
            }
        }