예제 #1
0
        private IContainer performInitialization(ApiConfig apiConfig)
        {
            var container = new AutofacContainer();

            container.RegisterImplementationOf((IContainer)container);

            var serializerRegister = new CoreSerializerRegister();

            using (container.OptimizeDependencyResolution())
            {
                container.RegisterImplementationOf(new SynchronizationContext());
                container.AddRegister(x => x.FromType <CoreRegister>());
                container.AddRegister(x => x.FromType <InfrastructureRegister>());
                container.AddRegister(x => x.FromType <InfrastructureImportRegister>());
                container.AddRegister(x => x.FromType <RRegister>());

                registerCoreDependencies(container);

                container.AddRegister(x => x.FromInstance(serializerRegister));
            }

            serializerRegister.PerformMappingForSerializerIn(container);

            initializeConfiguration(container, apiConfig);

            initializeDimensions(container);

            loadPKParameterRepository(container);

            return(container);
        }