コード例 #1
0
        /// <summary>
        /// 添加框架容器注册。
        /// </summary>
        /// <param name="services">服务容器集合。</param>
        /// <param name="configuration">配置接口。</param>
        /// <returns>返回服务集合实例对象。</returns>
        public static IServiceBuilder AddGentings(this IServiceCollection services, IConfiguration configuration)
        {
            var exportedTypes = GetExportedTypes(configuration);
            var builder       = new ServiceBuilder(services, configuration);

            BuildServices(builder, exportedTypes);
            return(builder);
        }
コード例 #2
0
        /// <summary>
        /// 添加框架容器注册。
        /// </summary>
        /// <param name="services">服务容器集合。</param>
        /// <param name="configuration">配置接口。</param>
        /// <returns>返回服务集合实例对象。</returns>
        public static IServiceBuilder AddGentings(this IServiceCollection services, IConfiguration configuration)
        {
            services.TryAddSingleton(typeof(IServiceAccessor <>), typeof(ServiceAccessor <>));
            var exportedTypes = GetExportedTypes(configuration);
            var builder       = new ServiceBuilder(services, configuration);

            BuildServices(builder, exportedTypes);
            return(builder);
        }