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)))); }
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(); }
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))); }
public RouteValueEqualityComparerTest() { _comparer = new RouteValueEqualityComparer(); }