public object Resolve(TypeKey typeKey, IDependencyOverrideOptions dependencyOverrideOptions)
        {
            typeKey.MustNotBeEmpty(nameof(typeKey));

            var dependencyOverrides = dependencyOverrideOptions?.MustBeOfType <DependencyOverrideOptions>(nameof(dependencyOverrideOptions)).Build();
            var resolveDelegateId   = new ResolveDelegateId(typeKey, dependencyOverrides);

            if (_resolveDelegates.TryGetValue(resolveDelegateId, out var resolveDelegate) == false)
            {
                var dependencyOverridesKey = dependencyOverrides?.CreateDependencyOverridesKey();
                resolveDelegate = Services.ResolveDelegateFactory.Create(typeKey, dependencyOverridesKey, this);
                resolveDelegate = _resolveDelegates.GetOrAdd(new ResolveDelegateId(typeKey, dependencyOverridesKey), resolveDelegate);
            }
            return(resolveDelegate(Services.ResolveContextFactory.Create(this, dependencyOverrides)));
        }
        public object Resolve(Registration registration, IDependencyOverrideOptions dependencyOverrideOptions = null)
        {
            registration.MustNotBeNull(nameof(registration));

            var dependencyOverrides = dependencyOverrideOptions?.MustBeOfType <DependencyOverrideOptions>(nameof(dependencyOverrideOptions)).Build();
            var resolveDelegateId   = new ResolveDelegateId(registration.TypeKey);

            if (_resolveDelegates.TryGetValue(resolveDelegateId, out var resolveDelegate) == false)
            {
                var dependencyOverridesKey = dependencyOverrides?.CreateDependencyOverridesKey();
                resolveDelegate = Services.ResolveDelegateFactory.Create(registration, dependencyOverridesKey, this);
                resolveDelegate = _resolveDelegates.GetOrAdd(new ResolveDelegateId(registration.TypeKey, dependencyOverridesKey), resolveDelegate);
            }

            return(resolveDelegate(Services.ResolveContextFactory.Create(this)));
        }
 public T Resolve <T>(Registration registration, IDependencyOverrideOptions dependencyOverrideOptions = null)
 {
     return((T)Resolve(registration, dependencyOverrideOptions));
 }
 public object Resolve(Type type, IDependencyOverrideOptions dependencyOverrideOptions, string registrationName = "")
 {
     return(Resolve(new TypeKey(type, registrationName), dependencyOverrideOptions));
 }
 public T Resolve <T>(IDependencyOverrideOptions dependencyOverrides, string registrationName = "")
 {
     return((T)Resolve(new TypeKey(typeof(T), registrationName), dependencyOverrides));
 }