Skip to content

Instantly share code, notes, and snippets.

@JRondeau16
Created May 12, 2015 16:58
Show Gist options
  • Save JRondeau16/d5988ac7cf2cda3dec0a to your computer and use it in GitHub Desktop.
Save JRondeau16/d5988ac7cf2cda3dec0a to your computer and use it in GitHub Desktop.
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