Skip to content

Instantly share code, notes, and snippets.

@straubt1
Created August 21, 2015 12:48
Show Gist options
  • Save straubt1/ade2e17f5cedfb93fe50 to your computer and use it in GitHub Desktop.
Save straubt1/ade2e17f5cedfb93fe50 to your computer and use it in GitHub Desktop.
AOPinIoC_DataInstaller
public class DataInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
var isProd = ConfigurationManager.AppSettings["IsProduction"] == "True";
container.Register(Component.For<ExceptionAspect>());
container.Register(Component.For<TimingAspect>());
var iProjData = Component.For<IProjectData>().ImplementedBy<ProjectDataLocal>();
iProjData.Interceptors(typeof(ExceptionAspect));
if (!isProd)
{
iProjData.Interceptors(typeof(TimingAspect));
}
container.Register(iProjData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment