Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers(options =>
                                    options.ModelBinderProviders.Insert(0, new CustomBinderProvider()));

            ProxyFigureInitializator.Initialize();

            services.AddSingleton <ProxyFigureStorage>()
            .AddSingleton <ProxyFigureValidator>()
            .AddSingleton <ProxyFigureCalculator>()
            .AddSingleton <ProxyFigureDescriptionProvider>();

            services.AddSingleton <IQueryFactory, QueryFactory>();

            string conStr = Configuration.GetConnectionString("figures");

            services.AddMediatR(typeof(CalcAreaHandler));

            services.AddSingleton(_ => new ConnectionFactory(conStr));
        }
Ejemplo n.º 2
0
 static ProxyFigureInitializatorTests()
 {
     ProxyFigureInitializator.Initialize();
 }