小编Der*_*ang的帖子

获取 Azure AD 用户在 .Net Core 声明中所属的组列表

我正在尝试使用“隐式流”中生成的令牌获取 .Net Core 中 Azure AD 用户所属的组列表。没有组信息。

我正在使用以下链接中提到的“隐式流”: .NET Core 和 Azure Active Directory 集成

下面显示了如何在 .NET Framework 中执行此操作,但 .NET Core 没有“ActiveDirectoryClient”类。

获取 Azure AD 用户在声明中所属的组列表

任何帮助深表感谢!

德里克

azure-active-directory .net-core

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

如何基于 rxjs 中的现有可观察创建新的可观察订阅?

我需要在我的项目中做以下几行(来自 https://github.com/devyumao/angular2-busy

ngOnInit() {
    this.busy = this.http.get('...').subscribe();
}
Run Code Online (Sandbox Code Playgroud)

在我的项目中,我根据路由更改发出请求,如下所示:

ngOnInit(): void {   
    this.activatedRoute
        .params
        .map(params => params['queryString'])
        .flatMap(id => this.http.(''))
        .subscribe(result => this.data = result);   
}
Run Code Online (Sandbox Code Playgroud)

每次路线发生变化时,我似乎都需要创建一个新订阅。我不知道该怎么做。

我只在寻找 rxjs 解决方案(不使用 Promise)。

谢谢!

德里克

javascript rxjs angular

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

如何让 routelink 返回正确的 URL?

这是复制问题的程序。

  1. 启动新的 mvc 4 项目。
  2. 将以下行添加到 RegisterRoutes() 方法中的“默认”路由之前

    routes.MapRoute(
            name: "Test",
            url: "Test/{action}",
            defaults: new { controller = "Test", action = "Index" }
    );
    
    Run Code Online (Sandbox Code Playgroud)
  3. 将以下内容添加到 Index.cshtml 和 About.cshtml

    @Html.RouteLink("link to TestController", "Test")
    
    Run Code Online (Sandbox Code Playgroud)

如您所见,生成的 html 代码对于 2 个页面是不同的。我希望 URL 是“/Test”,它为 Index.cshtml 正确呈现,但它成为 About.cshtml 的“/Test/About”。

我的问题是是否有任何记录的方法来生成相同的正确 URL。上面的例子只是为了演示目的而创建的。我想使用路由表信息来生成菜单。

asp.net-mvc asp.net-mvc-routing routelink

4
推荐指数
1
解决办法
1万
查看次数

Boost shared_ptr似乎不支持operator ==

这是在Windows 7下的最新QT IDE上运行的(boost.1.48)

class Employee {
public:
    int Id;
...
bool operator==(const Employee& other) {
       qDebug() << this->Id << ":" << "compare with " << other.Id;
       return this->Id==other.Id;
   }
}
Run Code Online (Sandbox Code Playgroud)

测试代码:

Employee jack1;
jack1 == jack1;   // the operator== gets invoked.

shared_ptr<Employee>  jack(new Employee);
jack == jack;  //  the operator== doesn't get invoked.
Run Code Online (Sandbox Code Playgroud)

boost头文件中的相关代码是:

template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b)
{
        return a.get() == b.get();
}
Run Code Online (Sandbox Code Playgroud)

它似乎正在做指针比较,而不是做我期望的.

我做错了什么?

c++ qt boost operator-overloading shared-ptr

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