Пример #1
0
        private void InitApi()
        {
            ContainerBuilder builder = new AutofacServiceProviderFactory().CreateBuilder(new ServiceCollection().AddHttpClient());

            builder.RegisterType <BlizzardApiReader>().As <IBlizzardApiReader>();
            builder.RegisterType <ApiWebClient>().As <IWebClient>();
            builder.Register(c => Options.Create(Configuration.GetSection("BlizzardApi").Get <BlizzardApiConfiguration>())).As <IOptions <BlizzardApiConfiguration> >();

            Api = builder.Build().Resolve <IBlizzardApiReader>();
        }