コード例 #1
0
ファイル: CompRoot.cs プロジェクト: ondrejmatousek/Personalka
        //Tato metoda je tu z důvodu testů. v projektu s testama se sestavuje kontejner s registracema metodou compose()
        public override void Compose()
        {
            IocContainer = new Container();  //vytvořím do interface nový object Container a přes interface naplním Container


            IocContainer.Register <IInzeratDao, InzeratDao>(Reuse.Singleton);
            IocContainer.Register <IUzivatelDao, UzivatelDao>(Reuse.Singleton);


            IocContainer.Register <IInzeratService, InzeratService>(Reuse.Singleton);
            IocContainer.Register <IUzivatelService, UzivatelService>(Reuse.Singleton);

            ////Ciselniky DAL
            //IocContainer.Register<ICiselnikTypPozemkuDao, CiselnikTypPozemkuDao>(Reuse.Singleton);
            //IocContainer.Register<ICiselnikProdejNeboPronajemDao, CiselnikProdejNeboPronajemDao>(Reuse.Singleton);

            ////Ciselniky Service
            //IocContainer.Register<ICiselnikTypPozemkuService, CiselnikTypPozemkuService>(Reuse.Singleton);
            //IocContainer.Register<ICiselnikProdejNeboPronajemService, CiselnikProdejNeboPronajemService>(Reuse.Singleton);



            //logovni vyjimek
            IocContainer.Register <LoggingAspect>();

            //IocContainer.Intercept<IPozemekService, LoggingAspect>();
            IocContainer.Intercept <IInzeratService, LoggingAspect>();
            IocContainer.Intercept <IUzivatelService, LoggingAspect>();

            DalInitializer.Init();
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime appLifetime)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();
            loggerFactory.AddSerilog();
            appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);

            DalInitializer.InitializeDatabase(app, Configuration, env);

            var identityServerAddress =
                Configuration.GetValue <string>(EnvironmentVariablesNames.IdentityServerHostAddress);

            app.UseCors("default");

            app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
            {
                Authority            = identityServerAddress,
                RequireHttpsMetadata = false,
                AllowedScopes        = new[] {
                    TicketTraderScopes.ApiAdministrativeScope,
                    TicketTraderScopes.ApiSaleScope,
                    TicketTraderScopes.ApiInternalScope,
                    TicketTraderClaims.TicketTraderStoreClaims
                },
                ApiName = TicketTraderScopes.FullApiScope,
            });

            app.UseMvc();

            app.UseSwaggerUi(typeof(Startup).GetTypeInfo().Assembly, new SwaggerUiSettings());
        }
コード例 #3
0
        //
        // GET: /Init/
        public ActionResult Index()
        {
            DataContext context = new DataContext();

            IDalInitializer initializer = new DalInitializer();
            initializer.Initialize();
            return Content("Success");
        }
コード例 #4
0
ファイル: Startup.cs プロジェクト: rafallopatka/TicketTrader
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              ILoggerFactory loggerFactory,
                              IApplicationLifetime appLifetime)
        {
            loggerFactory.ConfigureLogging(Configuration, appLifetime, "EventDefinitions.Gateway");
            DalInitializer.InitializeDatabase(app, Configuration, env);
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();
        }
コード例 #5
0
        public void Compose()
        {
            var compositionRoot = new CompositionRoot.CompositionRoot();

            compositionRoot.Compose();
            var IocContainer = compositionRoot.IocContainer;

            //IocContainer.Register<IAllDaos, AllDaos>();

            ConnectionStringSettings connString = ConfigurationManager.ConnectionStrings["ConnectionStringLocal"];

            IocContainer.UseInstance(connString);

            DalInitializer.Init();
        }
コード例 #6
0
ファイル: CompositionRoot.cs プロジェクト: Aky33/Inzerovani
        public void Compose()
        {
            IocContainer = new Container();


            //DAO VRSTVA
            IocContainer.Register <IInzeratDao, InzeratDao>();


            //Servisní Vrstva
            IocContainer.Register <IInzeratService, InzeratService>();


            //logování výjimek
            IocContainer.Register <LoggingAspect>();

            //zaregistrovani vsech sluzeb, ktere maji mit intercptor spolu s patricnym interceptorem
            IocContainer.Intercept <IInzeratService, LoggingAspect>();

            DalInitializer.Init();
        }