Esempio n. 1
0
 public static bool IsCollection(ITypeSymbol typeSymbol)
 {
     return(ObjectHelper.HasInterface(typeSymbol, "System.Collections.ICollection") ||
            ObjectHelper.HasInterface(typeSymbol, "System.Collections.IEnumerable") ||
            typeSymbol.Kind == SymbolKind.ArrayType);
 }
Esempio n. 2
0
 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));
 }