public ActionResult List(int numberToDisplay = 3) { var articles = GetNewsArticles(articleId: null) .Take(numberToDisplay) .ToArray(); if (!articles.Any()) { return(Content(string.Empty)); } var model = new NewsListRenderModel( articles: articles); return(PartialView(ViewNames.NewsListPartial, model)); }
public ActionResult List(int?numberToDisplay) { if (numberToDisplay == null) { numberToDisplay = AppLogic.AppConfigNativeInt("NumberOfNewsArticlesToShow"); } var articles = GetNewsArticles(articleId: null) .Take((int)numberToDisplay) .ToArray(); if (!articles.Any()) { return(Content(string.Empty)); } var model = new NewsListRenderModel( articles: articles); return(PartialView(ViewNames.NewsListPartial, model)); }