Exemplo n.º 1
0
 public static bool ContainsMatch(IEnumerable <string> actualNames, string requestedName, INameMatchResolver matchResolver)
 {
     return(actualNames.Any(x => matchResolver.IsMatch(x, requestedName)));
 }
Exemplo n.º 2
0
 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)));
 }
Exemplo n.º 3
0
 /// <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());
 }
Exemplo n.º 4
0
 public static bool AllMatch(IEnumerable <string> subset, IEnumerable <string> superset, INameMatchResolver matchResolver)
 {
     return(subset.All(x => superset.Any(y => matchResolver.IsMatch(x, y))));
 }