diff --git a/Features/Program.cs b/Features/Program.cs index 76b8798..76e63af 100644 --- a/Features/Program.cs +++ b/Features/Program.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Reflection.Metadata; namespace Features { @@ -54,6 +55,26 @@ namespace Features { Console.WriteLine(employee.Name); } + + // LINQ (Method syntax) + var query = developers.Where(e => e.Name.Length == 5) + .OrderBy(e => e.Name); + + // LINQ (Query syntax) + var query2 = from developer in developers + where developer.Name.Length == 5 + orderby developer.Name descending + select developer; + + foreach (var employee in query) + { + Console.WriteLine(employee.Name); + } + + foreach (var employee in query2) + { + Console.WriteLine(employee.Name); + } } } } \ No newline at end of file