示例#1
0
        public static HttpMethodAttribute[] GetHttpMethodAttributes(this IHttpFunction function)
        {
            var methodInfo     = function.GetType().GetMethod("HandleAsync");
            var httpAttributes = methodInfo.GetCustomAttributes(typeof(HttpMethodAttribute), false);

            return(httpAttributes.Cast <HttpMethodAttribute>().ToArray());
        }
示例#2
0
        public static AuthorizeAttribute[] GetAuthorizeAttributes(this IHttpFunction function)
        {
            var authorizeAttributes = function.GetType().GetCustomAttributes(typeof(AuthorizeAttribute), false);

            return(authorizeAttributes.Cast <AuthorizeAttribute>().ToArray());
        }