Skip to content

Instantly share code, notes, and snippets.

@glcheetham
Created May 27, 2016 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glcheetham/49f83f30775d3c422bd09c5eac8338c4 to your computer and use it in GitHub Desktop.
Save glcheetham/49f83f30775d3c422bd09c5eac8338c4 to your computer and use it in GitHub Desktop.
Umbraco DI Composition Root
using Autofac;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using Umbraco.Core;
using Umbraco.Core.Services;
namespace MyApplication
{
public class UmbracoApplication : IApplicationEventHandler
{
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
BundleConfig.RegisterBundles(BundleTable.Bundles);
var builder = new ContainerBuilder();
// Here we will register our components with our DI container
}
public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment