Example #1
0
        private static IEnumerable <ActionDescriptor> GetActions(
            IEnumerable <ActionDescriptor> actions,
            string area,
            string controller,
            string action)
        {
            var comparer = new RouteValueEqualityComparer();

            return
                (actions
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "area" && comparer.Equals(kvp.Value, area)))
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "controller" && comparer.Equals(kvp.Value, controller)))
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "action" && comparer.Equals(kvp.Value, action))));
        }
Example #2
0
        public static IEnumerable <ActionDescriptor> GetActions(
            IEnumerable <ActionDescriptor> actions,
            string area,
            string controller,
            string action)
        {
            var comparer = new RouteValueEqualityComparer();

            return
                (actions
                 // ReSharper disable ImplicitlyCapturedClosure
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "area" && comparer.Equals(kvp.Value, area)))
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "controller" && comparer.Equals(kvp.Value, controller)))
                 .Where(a => a.RouteValues.Any(kvp => kvp.Key == "action" && comparer.Equals(kvp.Value, action))));
        }
 public ActionDescriptorClassifier()
 {
     ValueComparer = new RouteValueEqualityComparer();
 }
 public OutboundMatchClassifier()
 {
     ValueComparer = new RouteValueEqualityComparer();
 }
Example #5
0
 public AttributeRouteLinkGenerationEntryClassifier()
 {
     ValueComparer = new RouteValueEqualityComparer();
 }
        private static IEnumerable<ActionDescriptor> GetActions(
            IEnumerable<ActionDescriptor> actions,
            string area,
            string controller,
            string action)
        {
            var comparer = new RouteValueEqualityComparer();

            return
                actions
                .Where(a => a.RouteConstraints.Any(c => c.RouteKey == "area" && comparer.Equals(c.RouteValue, area)))
                .Where(a => a.RouteConstraints.Any(c => c.RouteKey == "controller" && comparer.Equals(c.RouteValue, controller)))
                .Where(a => a.RouteConstraints.Any(c => c.RouteKey == "action" && comparer.Equals(c.RouteValue, action)));
        }
Example #7
0
 public RouteValueEqualityComparerTest()
 {
     _comparer = new RouteValueEqualityComparer();
 }