CSharp examples for System.Collections.Generic:IEnumerable
Cast Valid IEnumerable
// Permission is hereby granted, free of charge, to any person using System.Globalization; using System.Linq; using System.Collections; using System.Text; using System.Reflection; using System.Collections.ObjectModel; using System.Collections.Generic; using System;//from w ww. ja v a 2 s. co m public class Main{ public static IEnumerable<T> CastValid<T>(this IEnumerable enumerable) { ValidationUtils.ArgumentNotNull(enumerable, "enumerable"); return enumerable.Cast<object>().Where(o => o is T).Cast<T>(); } }