Пример #1
0
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddApplicationInsightsTelemetry(Configuration);
            AspNetRegistration.Register(services);

            services.AddMvc().AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            });

            var builder = new ContainerBuilder();

            builder.RegisterModule(new Registration());
            builder.Populate(services);

            var container = builder.Build();
            var customDependencyBuilder = new ContainerBuilder();

            customDependencyBuilder.RegisterInstance <ICustomDependencyResolver>(new CustomDependencyResolver(container));
            customDependencyBuilder.Update(container);

            Container = container;

            return(container.Resolve <IServiceProvider>());
        }
Пример #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();

            services.AddControllers()
            .AddNewtonsoftJson();

            services.AddSignalR();
            services.AddSwaggerGen();

            AspNetRegistration.Register(services, Configuration);
        }