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; } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); IoCConfig.RegisterDependencies(); }
protected void Application_Start() { // Register Inversion of Control dependencies IoCConfig.RegisterDependencies(); // Typical MVC setup // .... }
// 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(); }
protected void Application_Start() { IoCConfig.RegisterDependencies(); AreaRegistration.RegisterAllAreas(); AutoMapperConfiguration.Configure(); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
protected void Application_Start() { IoCConfig.RegisterDependencies(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
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()); }
protected override void Initialize() { IoCConfig.RegisterDependencies(); Dte = this.GetService(typeof(DTE)) as DTE2; AvoidCheckin.Initialize(this); base.Initialize(); }
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); }
// 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"; }); }
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"); }
// 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"; }); }