public static RouteNotMatched ( IEnumerable |
||
matchedRestrictions | IEnumerable |
|
unmatchedRestrictions | IEnumerable |
|
리턴 |
public MatchResult MatchesRequest(HttpRequestBase request) { request.ThrowIfNull("request"); Restrictions.MatchResult matchResult = new AndRestriction(_restrictions).MatchesRequest(request); return(matchResult.ResultType == Restrictions.MatchResultType.RestrictionMatched ? MatchResult.RouteMatched(matchResult.MatchedRestrictions, _id.ToString()) : MatchResult.RouteNotMatched(matchResult.MatchedRestrictions, matchResult.UnmatchedRestrictions)); }
public async Task <MatchResult> MatchesRequestAsync(HttpRequestBase request) { request.ThrowIfNull("request"); IRestriction[] restrictions = GetRestrictions().ToArray(); var matchingRestrictions = new List <IRestriction>(); foreach (IRestriction restriction in restrictions) { if (await restriction.MatchesRequestAsync(request)) { matchingRestrictions.Add(restriction); } } return(restrictions.Length == matchingRestrictions.Count ? MatchResult.RouteMatched(matchingRestrictions, _id.ToString()) : MatchResult.RouteNotMatched(matchingRestrictions, restrictions.Except(matchingRestrictions))); }