bool MatchesAnyCsharpPropertyOrFunction( IGivenClassProperty excelProperty, IEnumerable <PropertyInfo> properties, IEnumerable <MethodInfo> methods ) { return (properties.Any( cSharpProperty => excelCsharpPropertyMatcher.PropertiesMatch(cSharpProperty, excelProperty) ) || methods.Any( cSharpMethod => excelCsharpPropertyMatcher.MethodsMatch(cSharpMethod, excelProperty) )); }
MatchedProperty <T> MatchWithCsharpType <T>( T excelProperty, Type interfaceType) where T : IGivenClassProperty { // this gets things in ancestor interfaces as well as directly on the interface var properties = (new Type[] { interfaceType }) .Concat(interfaceType.GetInterfaces()) .SelectMany(i => i.GetProperties()); return(new MatchedProperty <T>() { ExcelProperty = excelProperty, CsharpProperty = properties .FirstOrDefault(c => excelCsharpPropertyMatcher.PropertiesMatch(c, excelProperty)) }); }