Is First in IEnumerable - CSharp System.Collections

CSharp examples for System.Collections:IEnumerable

Description

Is First in IEnumerable

Demo Code


using System.Linq;
using System.Collections.Generic;

public class Main{
        public static bool IsFirst<T>(this IEnumerable<T> list, T instance)
        {/*from  ww w.  j  a v  a2  s . c om*/
            return list.First().Equals(instance);
        }
}

Related Tutorials