Skip to content

Instantly share code, notes, and snippets.

@casper-rasmussen
Created August 14, 2017 18:08
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 casper-rasmussen/1e3b069000b4599a7726eb1fc87874e8 to your computer and use it in GitHub Desktop.
Save casper-rasmussen/1e3b069000b4599a7726eb1fc87874e8 to your computer and use it in GitHub Desktop.
//Use the Service Configuration abstraction in Episerver to apply logic to a given abstraction or implementation - here it's Episerver's IContentRepository.
context.Services.Intercept<IContentRepository>
//Add a ApplyMetricsTimingInterceptor, through Castle.Core dynamic proxies, to apply measurements
((c, i) => proxyGenerator.CreateInterfaceProxyWithTarget(i, new ApplyMetricsTimingInterceptor(c.GetInstance<IMetricManager>())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment