Beispiel #1
0
        public NewFeedbackTest()
        {
            var services = new ServiceCollection();

            services.AddAutoMapper();

            var container = new DryIocContainer();

            container.Install <MainServiceCoreContainerRegistration>();
            container.Populate(services);

            m_container = container;
            m_mapper    = container.Resolve <IMapper>();
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            // Configuration options
            services.AddOptions();
            services.Configure <List <EndpointOption> >(Configuration.GetSection("Endpoints"));

            // Add framework services.
            services.AddMvc();

            // Inject an implementation of ISwaggerProvider with defaulted settings applied
            services.AddSwaggerGen(options =>
            {
                options.DescribeAllEnumsAsStrings();
            });

            // IoC
            IIocContainer container = new DryIocContainer();

            container.Install <MainServiceContainerRegistration>();
            container.Install <NHibernateInstaller>();
            Container = container;

            return(container.CreateServiceProvider(services));
        }
Beispiel #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            // Authorization
            services.AddCustomAuthServices();

            // Configuration options
            services.AddOptions();
            services.Configure <List <EndpointOption> >(Configuration.GetSection("Endpoints"));

            services.Configure <FormOptions>(options =>
            {
                options.MultipartBodyLengthLimit = 1048576000;
            });

            services.AddMvc();

            // IoC
            IIocContainer container = new DryIocContainer();

            container.Install <WebHubContainerRegistration>();
            Container = container;

            return(container.CreateServiceProvider(services));
        }