示例#1
0
        /// <summary>
        /// Add modulos to current solution.
        /// For ASP.NET Core 3.1+ it's recommended to use <see cref="ModulosServiceProviderFactory" />.
        /// </summary>
        /// <param name="services">IServiceCollection instance.</param>
        /// <param name="modulos">Instance of modulos application</param>
        /// <param name="additionalData">Additional data available for modules.</param>
        public static IServiceCollection AddModulos(this IServiceCollection services,
                                                    ModulosApp modulos,
                                                    params object[] additionalData)
        {
            var factory = new ModulosServiceProviderFactory(modulos, null, additionalData);

            factory.CreateBuilder(services);
            return(services);
        }
示例#2
0
        /// <summary>
        /// Add modulos to current solution.
        /// For ASP.NET Core 3.1+ it's recommended to use <see cref="ModulosServiceProviderFactory" />.
        /// </summary>
        /// <param name="services">IServiceCollection instance.</param>
        /// <param name="modulos">Instance of modulos application</param>
        /// <param name="modifier">
        /// Enables to redefine detected modules. For example, it may be used to
        /// load only particular modules in test environments.
        /// </param>
        /// <param name="additionalData">Additional data available for modules.</param>
        public static IServiceCollection AddModulos(this IServiceCollection services,
                                                    ModulosApp modulos,
                                                    Action <AutoRegistrationModule> modifier = null,
                                                    params object[] additionalData)
        {
            var factory = new ModulosServiceProviderFactory(modulos, modifier, additionalData);

            factory.CreateBuilder(services);
            return(services);
        }