public HttpResponseMessage GetNewsByIdAndPermalink(int id, string permalink) { var article = magazineService.GetNewsByIdAndPermalink(id, permalink); if (article == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No se encontró la noticia.")); } var ads = magazineService.Api_Ads_GetByTags(article.Keywords, article.Category.MagazineId); return(Request.CreateResponse(HttpStatusCode.OK, TheModelFactory.Article_Response(article, ads))); }
public HttpResponseMessage ViewMagazineNew(string mGuid, int nId) { var article = magazineService.ApiGetNewById(mGuid, nId); if (article == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No se encontró la noticia.")); } var ads = magazineService.Api_Ads_GetByTags(article.Keywords, article.Category.MagazineId); return(Request.CreateResponse(HttpStatusCode.OK, TheModelFactory.Article_Response(article, ads))); }
public HttpResponseMessage GetNews(int id) { var news = magazineService.GetNewsById(id); if (news == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No se encontró la noticia.")); } var ads = magazineService.Api_Ads_GetByTags(news.Keywords, news.Category.MagazineId); return(Request.CreateResponse(HttpStatusCode.OK, TheModelFactory.Article_Response(news, ads))); }