Esempio n. 1
0
        private object Resolve(RegistrationItem registrationItem)
        {
            ResolutionContext resolutionContext = new ResolutionContext()
            {
                Container             = this,
                RegistrationContainer = this._registrationContainer,
                Arguments             = registrationItem.Arguments,
                RuntimeArguments      = registrationItem.RuntimeArguments,
                Registration          = registrationItem
            };

            object instance = registrationItem.ActivateInstance(resolutionContext);

            registrationItem.RuntimeArguments.AnonymousArguments = null;
            registrationItem.RuntimeArguments.NamedArguments     = null;

            return(instance);
        }
Esempio n. 2
0
        /// <summary>
        ///     Resolves a dependency internally with a registrationItem.
        /// </summary>
        /// <param name="registrationItem">The registrationItem to activate.</param>
        /// <returns>The resolved instance.</returns>
        private object Resolve(RegistrationItem registrationItem)
        {
            var resolutionContext = new ResolutionContext(
                this,
                _registrationContainer,
                registrationItem.Arguments,
                registrationItem.RuntimeArguments)
            {
                Registration = registrationItem
            };

            var instance = registrationItem.ActivateInstance(resolutionContext);

            // Clear all runtime arguments on registration.
            registrationItem.RuntimeArguments.AnonymousArguments = null;
            registrationItem.RuntimeArguments.NamedArguments     = null;

            return(instance);
        }