public static bool IsCollection(ITypeSymbol typeSymbol) { return(ObjectHelper.HasInterface(typeSymbol, "System.Collections.ICollection") || ObjectHelper.HasInterface(typeSymbol, "System.Collections.IEnumerable") || typeSymbol.Kind == SymbolKind.ArrayType); }
public static bool IsMappingBetweenCollections(ITypeSymbol targetClassSymbol, ITypeSymbol sourceClassSymbol) { return((ObjectHelper.HasInterface(targetClassSymbol, "System.Collections.ICollection") || targetClassSymbol.Kind == SymbolKind.ArrayType) && (ObjectHelper.HasInterface(sourceClassSymbol, "System.Collections.IEnumerable") || sourceClassSymbol.Kind == SymbolKind.ArrayType)); }