📜  allowanonymous 不使用自定义授权 - 无论代码示例

📅  最后修改于: 2022-03-11 14:54:57.154000             🧑  作者: Mango

代码示例1
private static bool SkipAuthorization(HttpActionContext actionContext)
{
    Contract.Assert(actionContext != null);

    return actionContext.ActionDescriptor.GetCustomAttributes().Any()
               || actionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes().Any();
}