Skip to content

Instantly share code, notes, and snippets.

@hartviglarsen
Created June 19, 2018 11:51
Show Gist options
  • Save hartviglarsen/168c99142c0c4dc69ee168e7c4b88d80 to your computer and use it in GitHub Desktop.
Save hartviglarsen/168c99142c0c4dc69ee168e7c4b88d80 to your computer and use it in GitHub Desktop.
Cloud *.Core
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