public void Resolver(IResolverContext context, IDependencyResolver resolver) { var single = ScopedCacheManager.GetCache((IScopedResolver)resolver, context.Dependency); context.Resolved = single; context.Handled = single != null; }
private void CacheResolved(IResolverContext context, IDependencyResolver resolver) { if (context.IsSingletonLifetime()) { ScopedCacheManager.SetCache(((DependencyResolver)resolver).RootScoped, context.Dependency, context.Resolved); } if (context.IsScopedLifetime()) { ScopedCacheManager.SetCache((IScopedResolver)resolver, context.Dependency, context.Resolved); } }