Last active
December 10, 2021 13:20
-
-
Save ouzdev/683e953577cbcbaf754e81bb126d0884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; | |
//LINQ sorgu sözdizimi | |
var query = from number in numbers | |
where number < 3 | |
select number; | |
//LINQ metod sözdizimi | |
var method = numbers.Where(n => n < 3); | |
Console.WriteLine("------------Sorgu Sözdizimi Sonuçları------------------"); | |
//Sorgu sözdizimi sonuçlarının ekrana basılması. | |
foreach (var item in query) | |
{ | |
Console.WriteLine(item.ToString()); | |
} | |
Console.WriteLine("------------Metod Sözdizimi Sonuçları------------------"); | |
//Metod sözdizimine ait olan sonuçların ekrana basılması. | |
foreach (var item in method) | |
{ | |
Console.WriteLine(item.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment