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