So we first get the last names from the Employees table and put them into a string array using the ToArray() construct and then we get the first 4 using the Take() construct.
string [] allEmployees1 = Employees.Select (e => e.LastName).Take(4).ToArray();
allEmployees1.Dump();
foreach (string s in allEmployees1)
Console.WriteLine(s);
Enjoy!
No comments:
Post a Comment