コード例 #1
0
        public async Task <IActionResult> GetByIdAsync(Guid id)
        {
            var regulation = await _regulationService.GetByIdAsync(id);

            if (regulation != null)
            {
                return(Ok(RegulationAdapter.ToRegulationDTO(regulation)));
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> GetAsync()
        {
            var regulations = await _regulationService.GetAllAsync();

            if (regulations.Any())
            {
                return(Ok(regulations.Select(x => RegulationAdapter.ToRegulationDTO(x))));
            }

            return(NoContent());
        }