示例#1
0
 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));
     }
 }
示例#2
0
        public IActionResult GetMayors()
        {
            var mayors = _mayorRepository.GetMayors();

            return(Ok(_mapper.Map <IEnumerable <MayorDto> >(mayors)));
        }