Пример #1
0
        public static TResult Build <T1, T2, T3, TResult>(this IComponentContext componentContext, Func <T1, T2, T3, TResult> buildAction)
            where T1 : class
            where T2 : class
            where T3 : class
        {
            #region Contracts

            if (componentContext == null)
            {
                throw new ArgumentException(nameof(componentContext));
            }
            if (buildAction == null)
            {
                throw new ArgumentException(nameof(buildAction));
            }

            #endregion

            // Build
            return(buildAction
                   (
                       componentContext.ResolveRequired <T1>(),
                       componentContext.ResolveRequired <T2>(),
                       componentContext.ResolveRequired <T3>()
                   ));
        }