public bool Equals(IPropertyPathPart other) { var otherProperty = other as PropertyPathPart; if (ReferenceEquals(otherProperty, null)) { return(false); } return(string.Equals(Value, otherProperty.Value, StringComparison.InvariantCultureIgnoreCase) || Value == "*" || otherProperty?.Value == "*"); }
public bool Equals(IPropertyPathPart other) { var otherArray = other as ArrayIndexPathPart; if (ReferenceEquals(otherArray, null)) { return(false); } if (exact || otherArray.exact) { return(Value == otherArray.Value); } return(Value == otherArray.Value || Value == "*" || otherArray.Value == "*"); }
public MatchingContext For(IPropertyPathPart property, bool?ignoreExpected = null, params IMatcher[] additionalMatchers) { var matchers = Matchers; if (additionalMatchers != null && additionalMatchers.Any()) { matchers = Matchers.Concat(additionalMatchers).ToArray(); } return(new MatchingContext(matchers, IsRequest, new List <IPropertyPathPart>(PropertyPath) { property }, Result) { IgnoreExpected = ignoreExpected.GetValueOrDefault(IgnoreExpected), TerminationRequested = TerminationRequested }); }