public IActionResult GetMayors([FromQuery] MayorResourceParameter resourceParameter) { try { var mayorEntities = _mayorRepository.GetMayors(resourceParameter); return(Ok(_mapper.Map <IEnumerable <MayorDTO> >(mayorEntities))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult GetMayors() { var mayors = _mayorRepository.GetMayors(); return(Ok(_mapper.Map <IEnumerable <MayorDto> >(mayors))); }