public IActionResult GetRssFeed() { return(Content(JsonConvert.SerializeObject(rssFeedService.GetRssFeed(), Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }), "application/json")); }
public IActionResult GetRssFeed() { try { var data = _rssFeedService.GetRssFeed(); var results = Mapper.Map <IEnumerable <RssFeedDomainObj> >(data); return(Ok(results)); } catch (Exception exception) { _logger.LogCritical($"Exception while getting Rss Feed", exception); return(StatusCode(500, "A problem happened while handling your request.")); } }
public ActionResult <List <ParsedEpisodeInfo> > Get(string url) { if (string.IsNullOrEmpty(url)) { return(BadRequest()); } try { return(Ok(_rssFeedService.GetRssFeed(url))); } catch (InvalidOperationException e) { return(BadRequest("Invalid element name during parsing")); } }