public async Task <IActionResult> GetAll() { IEnumerable <IRegulation> regulations = await _regulationService.GetAllAsync(); IEnumerable <RegulationModel> model = Mapper.Map <IEnumerable <IRegulation>, IEnumerable <RegulationModel> >(regulations); return(Ok(model)); }
public async Task <IActionResult> GetAsync() { var regulations = await _regulationService.GetAllAsync(); if (regulations.Any()) { return(Ok(regulations.Select(x => RegulationAdapter.ToRegulationDTO(x)))); } return(NoContent()); }