Ejemplo n.º 1
0
        public static bool GetFlag(HttpContext context)
        {
            bool flag     = false;
            var  Endpoint = HttpContextHelper.GetEndPoint(context);

            if (Endpoint == null)
            {
                return(flag);
            }
            var attributes  = Endpoint.Metadata;
            var NeedNot     = attributes.GetMetadata <NeedNotValidateAttribute>();
            var Need        = attributes.GetMetadata <NeedValidateAttribute>();
            int FirstIndex  = -1;
            int SecondIndex = -1;

            if (FirstIndex == -1 && SecondIndex == -1)
            {
                return(flag);
            }
            else
            {
                return(FirstIndex > SecondIndex ? !NeedNot.NeedNotValidate : NeedNot.NeedNotValidate);
            }
        }