public ActionResult Home(int pageNumber = 1) { try { if (pageNumber <= 0) { pageNumber = 1; } var contents = ContentModel.GetBlogContents(pageNumber); if (contents == null || !contents.Any()) { return(this.View(GetLayoutPath() + "404.cshtml")); } foreach (var content in contents) { content.Contents = ContentExtensions.ParseHtml(this.Tenant, content.Contents); } string theme = this.GetTheme(); string layout = ThemeConfiguration.GetBlogLayout(theme); var configuration = Configurations.GetDefaultConfiguration(); var model = new Blog { Contents = contents, LayoutPath = GetLayoutPath(), Layout = layout }; if (configuration != null) { model.Title = configuration.BlogTitle; model.Description = configuration.BlogDescription; } return(this.View(this.GetRazorView <AreaRegistration>("Blog/Home.cshtml"), model)); } catch (NpgsqlException ex) { Log.Error($"An exception was encountered while trying to get blog contents. Exception: {ex}"); } return(null); }