Beispiel #1
0
        /// <summary>
        /// 扫描注册
        /// </summary>
        /// <param name="services">服务集合</param>
        public static IServiceProvider ScanRegister(IServiceCollection services = null)
        {
            var builder = Bootstrapper.Run(services);

            return(DefaultContainer.CreateServiceProvider(builder));
        }
Beispiel #2
0
 /// <summary>
 /// 创建容器生成器
 /// </summary>
 /// <param name="services">服务列表</param>
 public ContainerBuilder CreateBuilder(IServiceCollection services)
 {
     Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
     services.AddSingleton <ISession, Session>();
     return(Bootstrapper.Run(services));
 }