asp.net5

ASP.Net MVC Angular 2 Final

夙愿已清 提交于 2019-12-02 22:20:34
Has anyone tried Angular 2 RC Final with ASP.Net MVC? I am having trouble with configuring Angular 2 RC 6 with ASP.Net MVC, till beta 17 everything was working fine. The package.json with below configuration doesn't seems to be working: "dependencies": { "@angular/common": "2.0.0-rc.6", "@angular/compiler": "2.0.0-rc.6", "@angular/core": "2.0.0-rc.6", "@angular/forms": "0.3.0", "@angular/http": "2.0.0-rc.6", "@angular/platform-browser": "2.0.0-rc.6", "@angular/platform-browser-dynamic": "2.0.0-rc.6", "@angular/router": "3.0.0-rc.1", "systemjs": "0.19.27", "core-js": "^2.4.0", "reflect-metadata

ASP.NET 5 DI app setting outside controller

北城以北 提交于 2019-12-02 00:04:15
问题 I can DI app setting in the controller like this private IOptions<AppSettings> appSettings; public CompanyInfoController(IOptions<AppSettings> appSettings) { this.appSettings = appSettings; } But how to DI that in my custom class like this private IOptions<AppSettings> appSettings; public PermissionFactory(IOptions<AppSettings> appSetting) { this.appSettings = appSettings; } my register in Startup.cs is services.Configure<AppSettings>(Configuration.GetSection("AppSettings")); 回答1: The "proper

ASP.NET 5 DI app setting outside controller

房东的猫 提交于 2019-12-01 20:47:00
I can DI app setting in the controller like this private IOptions<AppSettings> appSettings; public CompanyInfoController(IOptions<AppSettings> appSettings) { this.appSettings = appSettings; } But how to DI that in my custom class like this private IOptions<AppSettings> appSettings; public PermissionFactory(IOptions<AppSettings> appSetting) { this.appSettings = appSettings; } my register in Startup.cs is services.Configure<AppSettings>(Configuration.GetSection("AppSettings")); The "proper" way Register your custom class in the DI, the same way you register other dependencies in