public static bool ContainsMatch(IEnumerable <string> actualNames, string requestedName, INameMatchResolver matchResolver) { return(actualNames.Any(x => matchResolver.IsMatch(x, requestedName))); }
public static T BestMatch <T>(this IEnumerable <T> collection, Func <T, string> fieldFunc, string value, INameMatchResolver matchResolver) where T : class { return(collection.FirstOrDefault(x => matchResolver.IsMatch(fieldFunc(x), value))); }
/// <summary> /// Gets a mapped property /// </summary> /// <param name="propertyName"></param> /// <returns></returns> public PropertyInfo GetMappedProperty(string propertyName) { return((from t in MappedPropertiesWithNames where nameMatchResolver.IsMatch(t.Item2, propertyName) select t.Item1).FirstOrDefault()); }
public static bool AllMatch(IEnumerable <string> subset, IEnumerable <string> superset, INameMatchResolver matchResolver) { return(subset.All(x => superset.Any(y => matchResolver.IsMatch(x, y)))); }