質問

複数のフィルター属性をスタックすることは可能ですか?たとえば、人が「管理者」または「キュー」の許可を持っているかどうかをチェックするこの属性があります。

    [ClientPortalSecured("Administrator", "Queue")]
    public ActionResult Index()
    {
        return View(this.GetModel());
    }

しかし、これらと何か他のものをチェックしたいとしたらどうでしょうか?このようなことをすることは可能ですか?

    [ClientPortalSecured("Administrator", "Queue")]
    [ClientPortalSecured("abc")]
    public ActionResult Index()
    {
        return View(this.GetModel());
    }

現在、これを試してみると、「clientportalsecured」属性「コンパイラエラー」を「複製」します。

役に立ちましたか?

解決

それを見つけた。追加した

[AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = true)]

ClientPortalScuredAttributeクラスに

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top