/// <summary>
/// 转换IList<T>为List<T>
/// </summary>
/// <typeparam name="T">指定的集合中泛型的类型</typeparam>
/// <param name="gbList">需要转换的IList</param>
/// <returns></returns>
public static List<T> ConvertIListToList<T>(IList<T> gbList) where T : class
{
if (gbList != null && gbList.Count >= 1)
{
List<T> list = new List<T>();
for (int i = 0; i < gbList.Count; i++)
{
T temp = gbList[i] as T;
if (temp != null)
list.Add(temp);
}
return list;
}
return null;
Ilist<T>转换为List<T>
最新推荐文章于 2024-04-22 07:45:14 发布