IEnumerable To List - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:List

Description

IEnumerable To List

Demo Code


using System.Collections.Generic;
using System;/*  w  w  w  . jav a 2s.  c  o  m*/

public class Main{
        internal static List<T> ToList<T> (IEnumerable<T> src)
        {
            if (src == null) {
                return null;
            }
            return new List<T>(src);
        }
}

Related Tutorials