Exemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <Ad> > > GetAds([FromQuery] Filter filter)
        {
            try {
                var ads = await adService.GetAds(filter);

                return(Ok(ads));
            } catch (ArgumentOutOfRangeException e) {
                throw new HttpResponseException {
                          Status = 400,
                          Value  = e.Message
                };
            } catch (System.Exception e) {
                throw new HttpResponseException {
                          Status = 500,
                          Value  = e.Message
                };
            }
        }