From 29b3fe1fe14e96065b5a505831d200eb2daddcbc Mon Sep 17 00:00:00 2001 From: Vladimir Pecanac Date: Wed, 23 Sep 2026 14:04:44 +0200 Subject: [PATCH] Dynamic LINQ: retarget net10.0, System.Linq.Dynamic.Core 1.7.4, Program.cs prints the article's outputs - Both projects net6.0 to net10.0. - System.Linq.Dynamic.Core 1.2.21 to 1.7.4. 1.2.21 sits inside both published advisory ranges: GHSA-w65q-jcmv-28gj / CVE-2023-32571 (critical, CVSS 9.8, >= 1.0.7.10 and < 1.3.0) and GHSA-4cv2-4hjh-77rx / CVE-2024-51417 (high, < 1.6.0). - Test packages: Microsoft.NET.Test.Sdk 18.10.1, NUnit 4.6.1, NUnit3TestAdapter 6.3.0, NUnit.Analyzers 4.15.0, coverlet.collector 10.0.1. No assertion changes. - Program.cs now prints the projection, the multi-property sort and the combined lambda filter that the article quotes, so its output blocks can be re-run. --- .../SystemDynamicLinqCoreLibrary/Program.cs | 26 ++++++++++++++++++- .../SystemDynamicLinqCoreLibrary.csproj | 4 +-- .../Tests/Tests.csproj | 12 ++++----- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/Program.cs b/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/Program.cs index ee70bff2f0..e6a72caaa0 100644 --- a/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/Program.cs +++ b/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/Program.cs @@ -1 +1,25 @@ -Console.WriteLine("Application Started"); \ No newline at end of file +using SystemDynamicLinqCoreLibrary; + +Console.WriteLine("Application Started"); + +var testData = new TestData(); + +Console.WriteLine(); +Console.WriteLine($"{"Name",-20}Department"); +Console.WriteLine(new string('=', 47)); +foreach (var employee in testData.SelectEmployees()) +{ + Console.WriteLine($"{(string)employee.Name,-20}{(string)employee.Department}"); +} + +Console.WriteLine(); +foreach (var employee in testData.SortEmployeesByMultipleProperties()) +{ + Console.WriteLine($"Name: {employee.Name}, Dept: {employee.Department}"); +} + +Console.WriteLine(); +foreach (var employee in testData.CreateDynamicLambdaExpressions("IT", 18)) +{ + Console.WriteLine($"Name: {employee.Name}, Age: {employee.Age}"); +} diff --git a/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary.csproj b/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary.csproj index 074f8ea3dc..81e9463325 100644 --- a/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary.csproj +++ b/csharp-linq/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary/SystemDynamicLinqCoreLibrary.csproj @@ -2,13 +2,13 @@ Exe - net6.0 + net10.0 enable disable - + diff --git a/csharp-linq/SystemDynamicLinqCoreLibrary/Tests/Tests.csproj b/csharp-linq/SystemDynamicLinqCoreLibrary/Tests/Tests.csproj index d8f463ba99..fe303b2dd0 100644 --- a/csharp-linq/SystemDynamicLinqCoreLibrary/Tests/Tests.csproj +++ b/csharp-linq/SystemDynamicLinqCoreLibrary/Tests/Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net10.0 enable enable @@ -9,11 +9,11 @@ - - - - - + + + + +