Ejemplo n.º 1
0
        public static bool IsOfResource(this ActionDescriptor action, string resourceCode, EndpointScope scope)
        {
            var hateoasAttr = action.GetHateoasAttribute();

            return(hateoasAttr.ResourceCode == resourceCode &&
                   hateoasAttr.Scope == scope);
        }
Ejemplo n.º 2
0
        public static bool IsActionFor(this ActionDescriptor action, string resourceCode, EndpointScope scope)
        {
            bool isHttpGet = action.IsHttpGet();

            if (isHttpGet)
            {
                return(false);
            }

            var hateoasAttr = action.GetHateoasAttribute();

            return(hateoasAttr.ResourceCode == resourceCode &&
                   hateoasAttr.Scope == scope);
        }