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()); }
public static AuthorizeAttribute[] GetAuthorizeAttributes(this IHttpFunction function) { var authorizeAttributes = function.GetType().GetCustomAttributes(typeof(AuthorizeAttribute), false); return(authorizeAttributes.Cast <AuthorizeAttribute>().ToArray()); }