Exemplo n.º 1
0
        public async Task <List <TravelPlanStatusDto> > ListAsync()
        {
            var tpStatuses = await _travelPlanStatusRepository.ListAsync();

            var tpStatusDtos = tpStatuses.Select(tps => new TravelPlanStatusDto()
            {
                UniqStatus = tps.UniqStatus, Description = tps.Description
            }).ToList();

            return(tpStatusDtos);
        }
        public async Task <IActionResult> List()
        {
            try
            {
                var statuses = await _travelPlanStatusRepository.ListAsync();

                return(Ok(statuses));
            }
            catch
            {
                throw;
            }
        }