commit 305d5f569adeccade9bf5a2114c4a8eb2c04c68d Author: Louis Gallet Date: Tue May 7 12:27:58 2024 +0200 feat: :sparkles: Add Lecture diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.LectureLinq/.idea/.gitignore b/.idea/.idea.LectureLinq/.idea/.gitignore new file mode 100644 index 0000000..702670e --- /dev/null +++ b/.idea/.idea.LectureLinq/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/.idea.LectureLinq.iml +/modules.xml +/projectSettingsUpdater.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.LectureLinq/.idea/encodings.xml b/.idea/.idea.LectureLinq/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.LectureLinq/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.LectureLinq/.idea/indexLayout.xml b/.idea/.idea.LectureLinq/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.LectureLinq/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.LectureLinq/.idea/vcs.xml b/.idea/.idea.LectureLinq/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.LectureLinq/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LectureLinq.sln b/LectureLinq.sln new file mode 100644 index 0000000..19a6c2d --- /dev/null +++ b/LectureLinq.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LectureLinq", "LectureLinq\LectureLinq.csproj", "{C312AD6D-7757-42CF-9339-8749DE02AF12}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C312AD6D-7757-42CF-9339-8749DE02AF12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C312AD6D-7757-42CF-9339-8749DE02AF12}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C312AD6D-7757-42CF-9339-8749DE02AF12}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C312AD6D-7757-42CF-9339-8749DE02AF12}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/LectureLinq/LectureLinq.csproj b/LectureLinq/LectureLinq.csproj new file mode 100644 index 0000000..2f4fc77 --- /dev/null +++ b/LectureLinq/LectureLinq.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/LectureLinq/Program.cs b/LectureLinq/Program.cs new file mode 100644 index 0000000..1523e5a --- /dev/null +++ b/LectureLinq/Program.cs @@ -0,0 +1,19 @@ +namespace LectureLinq; + +public static class Program +{ + public static void Main() + { + int[] scores = {24, 232, 354, 35, 46, 57, 68, 79, 80, 91, 102, 113, 124, 135, 146, 157, 168, 179, 190, 201, 212, 223, 234, 245, 256, 267, 278, 289, 300}; + + var query = + from score in scores // Select the data from the collection + where score % 2 == 0 && score.ToString().Contains("4") // Filter the data + orderby score descending // Order the data in descending order + select score; // Select the data to be returned + foreach (var i in query) + { + Console.WriteLine(i); + } + } +} \ No newline at end of file