public async Task <IActionResult> GetByIdAsync(Guid id) { var regulation = await _regulationService.GetByIdAsync(id); if (regulation != null) { return(Ok(RegulationAdapter.ToRegulationDTO(regulation))); } return(NoContent()); }
public async Task <IActionResult> GetAsync() { var regulations = await _regulationService.GetAllAsync(); if (regulations.Any()) { return(Ok(regulations.Select(x => RegulationAdapter.ToRegulationDTO(x)))); } return(NoContent()); }