Beispiel #1
0
        /// <summary>
        /// Executes the register.
        /// </summary>
        /// <param name="scanner">The scanner.</param>
        /// <param name="context">The context.</param>
        /// <param name="types">The types.</param>
        public static void Register(
            [NotNull] IConventionScanner scanner,
            [NotNull] IConventionContext context,
            IEnumerable <Type> types
            )
        {
            if (scanner == null)
            {
                throw new ArgumentNullException(nameof(scanner));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            Register(context, scanner.BuildProvider().GetAll(context.GetHostType()), types);
        }
Beispiel #2
0
        /// <summary>
        /// Executes the register.
        /// </summary>
        /// <param name="scanner">The provider.</param>
        /// <param name="context">The context.</param>
        public static void Register <TContext, TContribution, TDelegate>(
            [NotNull] IConventionScanner scanner,
            [NotNull] IConventionContext context
            )
            where TContext : IConventionContext
            where TContribution : IConvention <TContext>
            where TDelegate : Delegate
        {
            if (scanner == null)
            {
                throw new ArgumentNullException(nameof(scanner));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            Register(
                context,
                scanner.BuildProvider().Get <TContribution, TDelegate>(context.GetHostType()),
                new[] { typeof(TContribution), typeof(TDelegate) }
                );
        }