小编Jai*_*ira的帖子

ASP.Net MVC:在现有项目上从“无身份验证”更改为“个人用户帐户”

我正在学习有关ASP.Net MVC的课程,并且达到了该课程依赖标准的“注册”和“登录”功能的功能,在创建项目时选择“单个用户帐户”时,Visual Studio会自动构建这些功能。

显然,Visual Studio的较新版本现在默认为“无身份验证”。

我已经建立了很多东西,创建一个新项目并移走所有东西会很痛苦。有没有更简单的方法来更改身份验证类型(并生成相应的页面和控制器)?

(我不想添加身份并手动调整身份验证过程,我希望得到与创建带有“个人用户帐户”设置的新项目相同的结果-使用VS创建默认控制器和视图)

authentication asp.net-mvc visual-studio-2017

5
推荐指数
1
解决办法
7377
查看次数

构建调用第二个 http 服务以向模型添加附加数据的 rxjs 管道序列

问题:我是 RXJS 的新手,很难更改正在获取 http 数据并将其有条件地保存在存储中的管道(如果状态处于活动状态)。缺少的属性之一,我需要逐项使用另一个 http 服务,以在保存到商店之前获取该缺少的属性。无需对具有 active=false 标志的项目调用第二个 http 服务。

例子

获取http数据的2种方法:

FetchHttpData1() : Observable<IMainModelType[]>

FetchHttpItemProperty(id:number) : Observable<IMissingPropertyType>
Run Code Online (Sandbox Code Playgroud)

楷模:

interface IMainModelType {
  id:number,
  name:string,
  missingProperty:string, //always null
  active:boolean
}

interface IMissingPropertyType{
  id:number,
  missingProperty:string
}
Run Code Online (Sandbox Code Playgroud)

到目前为止的代码:

let myObs = this.FetchHttpData1().pipe(
  map((values) => { 
    values.forEach((singleValue) => {

      if(singleValue.active) {
        //this singleValue is being saved with a missing property and we dont want that
        //at this stage I need to response from FetchHttpItemProperty() to try and set the missing property …
Run Code Online (Sandbox Code Playgroud)

rxjs angular

2
推荐指数
1
解决办法
409
查看次数