Skip to content

Instantly share code, notes, and snippets.

@asmorger
Last active February 26, 2016 12:49
Show Gist options
  • Select an option

  • Save asmorger/9911426f30d635b148dc to your computer and use it in GitHub Desktop.

Select an option

Save asmorger/9911426f30d635b148dc to your computer and use it in GitHub Desktop.
Cash Dependency Injection Configuration
public stitac class DependencyInjectionConfiguration
{
public static void Register(ContainerBuilder builder,
ICacheKeyRegistrationService cacheKeyRegistrationService)
{
Cash.RegisterCacheInfrastructure(builder,
MemoryCache.Default,
cacheKeyRegistrationService);
builder.RegisterType<UserService>()
.As<IUserService>()
.InstancePerHttpRequest()
.WithDefaultCache();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment