Created
June 19, 2018 11:51
-
-
Save hartviglarsen/168c99142c0c4dc69ee168e7c4b88d80 to your computer and use it in GitHub Desktop.
Cloud *.Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Hartviglarsen.Core.ViewModels; | |
using Hartviglarsen.Factories; | |
using System.Web.Mvc; | |
using Umbraco.Web.Models; | |
using Umbraco.Web.Mvc; | |
namespace Hartviglarsen.Core.Controllers | |
{ | |
public class BlogController : RenderMvcController | |
{ | |
private readonly ISidebarFactory _sidebarFactory; | |
public BlogController(ISidebarFactory sidebarFactory) | |
{ | |
_sidebarFactory = sidebarFactory; | |
} | |
public override ActionResult Index(RenderModel model) | |
{ | |
var sidebar = _sidebarFactory.Create(model.Content.Children); | |
var vm = new BlogViewModel(model.Content) | |
{ | |
Sidebar = sidebar | |
}; | |
return CurrentTemplate(vm); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment