Ejemplo n.º 1
0
 protected override void BeginProcessing()
 {
     if (!String.IsNullOrEmpty(GroupAxis) &&
         !Include.Contains(GroupAxis, StringComparer.InvariantCultureIgnoreCase))
     {
         var names = new List <string>(Include);
         names.Add(GroupAxis);
         Include = names.ToArray();
     }
     base.BeginProcessing();
 }
        private IEnumerable <KeyValuePair <string, string> > GetPairsToInclude()
        {
            var httpRequest = HttpContextAccessor?.HttpContext?.TryGetRequest();
            var pairs       = new List <KeyValuePair <string, string> >();

            if (httpRequest.Form != null)
            {
                foreach (string key in httpRequest.Form.Keys)
                {
                    if ((!Include.Any() || Include.Contains(key)) && !Exclude.Contains(key))
                    {
                        pairs.Add(new KeyValuePair <string, string>(key, httpRequest.Form[key]));
                    }
                }
            }

            return(pairs);
        }