public static string[] ToStringArray(ICollection collection) { if (collection == null) { return null; } return collection.Cast<string>().ToArray(); }