Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System.Web.Mvc;
using Sitecore.Mvc.Controllers;
namespace MyProjectNamespace.Controllers
{
public class TestController : SitecoreController
{
private readonly IInjectedClass _injectedClass;
public TestController()
{
_injectedClass = Sitecore.Configuration.Factory.CreateObject("guide/InjectedClass", true) as InjectedClass;
}
public ActionResult MyAction()
{
var val = _injectedClass.TestMethod();
//Do work with ability to utilize injected class
return View();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment