Self Closures Consol
Self close consol application
Program.cs
Program.cs
static void Main(string[] args) { ListMyClass.cslstofclass = new List { new MyClass { Name = "Darshan", Credit=3000}, new MyClass { Name= "Hardik", Credit= 2000}, new MyClass { Name = "Bhaumik", Credit=6000}, new MyClass { Name= "Rachit", Credit=9000} }; var items = lstofclass.Where(item => item.Credit > 3000); Program.ForEach (items, x => Console.WriteLine("Name : {0}", x.Name)); Console.ReadLine(); } public static void ForEach (IEnumerable source, Action myaction) { foreach (var x in source) myaction(x); }
class MyClass { public string Name { get; set; } public int Credit { get; set; } }
Self Closures Consol
Reviewed by Bhaumik Patel
on
11:52 PM
Rating: