static public Type[] GetGenericParameterTypes(this MethodBase item) { if (item.IsGenericTypelessMethod()) { return(item.GetGenericArguments()); } return(Empty.Array <Type>()); }
static public T[] ToArray <T>(this IEnumerable <T> item) { ICollection <T> collection; if (item == null) { return(Empty.Array <T>()); } if (item.Convert <ICollection <T> >(out collection)) { return(collection.ToArray()); } return(item.ToList().ToArray()); }