Esempio n. 1
0
        public void Setup()
        {
            if (!this._isIoCInit)
            {
                this.RegisterDependencies(FreshTinyIoCContainer.Current);
                IoCConfig.RegisterDependencies(FreshTinyIoCContainer.Current);

                this._isIoCInit = true;
            }

            if (!this._isMapperInit)
            {
                Mapper.Initialize(cfg =>
                {
                    this.RegisterMappers(cfg);
                    MapperConfig.RegisterMappers(cfg);
                });

                this._isMapperInit = true;
            }

            if (!this._isPageModelMapperInit)
            {
                FreshPageModelResolver.PageModelMapper = new PageModelMapper();

                this._isPageModelMapperInit = true;
            }
        }
Esempio n. 2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RouteConfig.RegisterRoutes(RouteTable.Routes);
            IoCConfig.RegisterDependencies();
        }
Esempio n. 3
0
 protected void Application_Start()
 {
     // Register Inversion of Control dependencies
     IoCConfig.RegisterDependencies();
     // Typical MVC setup
     // ....
 }
Esempio n. 4
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddCors();
     //RSAEncryptionProvider.GenerateRSAKeysAndSave();
     IoCConfig.RegisterDependencies(services, Configuration);
     services.AddControllers().AddNewtonsoftJson();
 }
Esempio n. 5
0
 protected void Application_Start()
 {
     IoCConfig.RegisterDependencies();
     AreaRegistration.RegisterAllAreas();
     AutoMapperConfiguration.Configure();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
Esempio n. 6
0
 protected void Application_Start()
 {
     IoCConfig.RegisterDependencies();
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
Esempio n. 7
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     IoCConfig.RegisterDependencies(BuildManager.GetReferencedAssemblies().Cast <Assembly>().ToArray());
 }
Esempio n. 8
0
        protected override void Initialize()
        {
            IoCConfig.RegisterDependencies();

            Dte = this.GetService(typeof(DTE)) as DTE2;

            AvoidCheckin.Initialize(this);
            base.Initialize();
        }
Esempio n. 9
0
 protected void Application_Start()
 {
     // Register Inversion of Control dependencies
     IoCConfig.RegisterDependencies();
     AutoMapperConfig.Configure();
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
        public void Configuration(IAppBuilder app)
        {
            IContainer container = IoCConfig.RegisterDependencies();

            DependencyResolver.SetResolver(new Autofac.Integration.Mvc.AutofacDependencyResolver(container));

            //Auto mapper registration
            AutoMapperWebConfiguration.Configure();

            ConfigureAuth(app);
        }
Esempio n. 11
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            IoCConfig.RegisterDependencies(services, Configuration);
            services.AddScoped <SecurityActionFilter>();

            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options =>
            {
                options.TokenValidationParameters = new TokenValidationParameters
                {
                    ValidateIssuer           = true,
                    ValidateAudience         = true,
                    ValidateLifetime         = true,
                    ValidateIssuerSigningKey = true,
                    ValidIssuer      = Configuration["Jwt:Issuer"],
                    ValidAudience    = Configuration["Jwt:Audience"],
                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Jwt:Key"]))
                };
            });


            //services.AddControllers().AddNewtonsoftJson();

            services.AddMvc(o =>
            {
                var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
                // By Convention we are securring every endpoint.
                o.Filters.Add(new AuthorizeFilter(policy));
            }).AddMvcOptions(options => {
                options.Filters.Add(new SecurityActionFilter());
            });

            services.AddCors(o => o.AddPolicy("AllowAllOrigins", builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader();
            }));

            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration =>
            {
                configuration.RootPath = "ClientApp/dist";
            });
        }
Esempio n. 12
0
        protected void Application_Start()
        {
            logger.Info("Starting BF.POC.FaceAPI...");

            IoCConfig.RegisterDependencies();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) =>
            //{
            //    logger.Error(eventArgs.Exception);
            //};

            logger.Info("BF.POC.FaceAPI has been started successfully");
        }
Esempio n. 13
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(options =>
            {
                options.AddPolicy("CorsPolicy",
                                  builder =>
                                  builder.AllowAnyOrigin()
                                  .AllowAnyMethod()
                                  .AllowAnyHeader());
            });

            IoCConfig.RegisterDependencies(services, Configuration);
            services.AddControllersWithViews();

            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration =>
            {
                configuration.RootPath = "ClientApp/dist";
            });
        }