/// <summary>
        /// PerCallInlinedParamsInterfaceLifetime constructor
        /// </summary>
        /// <param name="outType">The type of the object to be stored in the current Lifetime container</param>
        /// <param name="createInstObj">Instance creator</param>
        public PerCallInlinedParamsInterfaceLifetime(Type outType, IInstanceCreatorNoParam createInstObj)
            : base(outType)
        {
            Contract.Requires <ArgumentNullException>(createInstObj != null, "createInstObj");

            _createInstanceObj = createInstObj;
        }
Beispiel #2
0
        private T ValidateInstCreator <T>(IInstanceCreatorNoParam instCreator)
        {
            var obj = instCreator.CreateInstance();

            Assert.IsNotNull(obj);
            Assert.IsTrue(obj is T);

            return((T)obj);
        }
        /// <summary>
        /// PerCallInlinedParamsInterfaceLifetime constructor
        /// </summary>
        /// <param name="outType">The type of the object to be stored in the current Lifetime container</param>
        /// <param name="createInstObj">Instance creator</param>
        public PerCallInlinedParamsInterfaceLifetime(Type outType, IInstanceCreatorNoParam createInstObj)
            : base(outType)
        {
            if (createInstObj == null)
            {
                throw new ArgumentNullException(nameof(createInstObj));
            }

            _createInstanceObj = createInstObj;
        }