From 9df19e9e76d45322d616fdcf31eb8ae3df270365 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:12:53 +1000 Subject: [PATCH 1/8] Add tests for EF Core 8.0 --- DelegateDecompiler.sln | 6 ++++++ DelegateDecompiler.sln.DotSettings | 5 ++++- .../DetailedListOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommandsWithSQL.md | 2 +- .../GeneratedDocumentation/SummaryOfSupportedCommands.md | 2 +- .../Helpers/MarkupFileHelpers.cs | 4 +++- .../DetailedListOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommandsWithSQL.md | 2 +- .../GeneratedDocumentation/SummaryOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommandsWithSQL.md | 2 +- .../GeneratedDocumentation/SummaryOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommands.md | 2 +- .../DetailedListOfSupportedCommandsWithSQL.md | 2 +- .../GeneratedDocumentation/SummaryOfSupportedCommands.md | 2 +- test.cmd | 1 + 16 files changed, 26 insertions(+), 14 deletions(-) diff --git a/DelegateDecompiler.sln b/DelegateDecompiler.sln index 3e1011fe..0607c51b 100644 --- a/DelegateDecompiler.sln +++ b/DelegateDecompiler.sln @@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DelegateDecompiler.EntityFr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DelegateDecompiler.EntityFrameworkCore5", "src\DelegateDecompiler.EntityFrameworkCore5\DelegateDecompiler.EntityFrameworkCore5.csproj", "{79DA2FBB-7A35-4AFF-A89B-CF8F5DADC1B2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFrameworkCore8.Tests", "src\DelegateDecompiler.EntityFrameworkCore8.Tests\DelegateDecompiler.EntityFrameworkCore8.Tests.csproj", "{4B729DD4-7A37-4D16-B241-10DD5B12EDA0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -81,6 +83,10 @@ Global {79DA2FBB-7A35-4AFF-A89B-CF8F5DADC1B2}.Debug|Any CPU.Build.0 = Debug|Any CPU {79DA2FBB-7A35-4AFF-A89B-CF8F5DADC1B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {79DA2FBB-7A35-4AFF-A89B-CF8F5DADC1B2}.Release|Any CPU.Build.0 = Release|Any CPU + {4B729DD4-7A37-4D16-B241-10DD5B12EDA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B729DD4-7A37-4D16-B241-10DD5B12EDA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B729DD4-7A37-4D16-B241-10DD5B12EDA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B729DD4-7A37-4D16-B241-10DD5B12EDA0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DelegateDecompiler.sln.DotSettings b/DelegateDecompiler.sln.DotSettings index 2939749e..830bd85b 100644 --- a/DelegateDecompiler.sln.DotSettings +++ b/DelegateDecompiler.sln.DotSettings @@ -5,8 +5,11 @@ True <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> True True True True - True \ No newline at end of file + True + True \ No newline at end of file diff --git a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md index 82a7ccf4..b782475a 100644 --- a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md @@ -1,6 +1,6 @@ Detail of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:36 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework v6.1](http://msdn.microsoft.com/en-us/data/aa937723) (EF). diff --git a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md index 0f61cb3a..962a95bc 100644 --- a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md +++ b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md @@ -1,6 +1,6 @@ Detail With Sql of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:36 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework v6.1](http://msdn.microsoft.com/en-us/data/aa937723) (EF). diff --git a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md index 1a7a23c4..2e578d38 100644 --- a/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFramework.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md @@ -1,6 +1,6 @@ Summary of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:36 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework v6.1](http://msdn.microsoft.com/en-us/data/aa937723) (EF). diff --git a/src/DelegateDecompiler.EntityFramework.Tests/Helpers/MarkupFileHelpers.cs b/src/DelegateDecompiler.EntityFramework.Tests/Helpers/MarkupFileHelpers.cs index 37215a98..aa97a32b 100644 --- a/src/DelegateDecompiler.EntityFramework.Tests/Helpers/MarkupFileHelpers.cs +++ b/src/DelegateDecompiler.EntityFramework.Tests/Helpers/MarkupFileHelpers.cs @@ -68,11 +68,13 @@ static bool GetMarkupFileDirectory(string pathToManipulate, string alternateTest @"\bin\debug\netcoreapp2.1", @"\bin\debug\netcoreapp3.1", @"\bin\debug\net6.0", + @"\bin\debug\net8.0", @"\bin\release", @"\bin\release\net45", @"\bin\release\netcoreapp2.1", @"\bin\release\netcoreapp3.1", - @"\bin\release\net6.0" + @"\bin\release\net6.0", + @"\bin\release\net8.0", }; foreach (var ending in endings) { diff --git a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md index 457d5b64..18b3dd6f 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md @@ -1,6 +1,6 @@ Detail of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:09 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md index 3b763afd..1f0e4450 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md +++ b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md @@ -1,6 +1,6 @@ Detail With Sql of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:09 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md index 34cf5223..6dbe5e13 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md @@ -1,6 +1,6 @@ Summary of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:09 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md index 359b7016..25b7ae97 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md @@ -1,6 +1,6 @@ Detail of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md index 1e001df1..589c4196 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md +++ b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md @@ -1,6 +1,6 @@ Detail With Sql of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md index add4b1f9..56ec9cc0 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore3.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md @@ -1,6 +1,6 @@ Summary of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md index 359b7016..25b7ae97 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md @@ -1,6 +1,6 @@ Detail of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md index d36f0da9..945b3693 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md +++ b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md @@ -1,6 +1,6 @@ Detail With Sql of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md index add4b1f9..56ec9cc0 100644 --- a/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md +++ b/src/DelegateDecompiler.EntityFrameworkCore6.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md @@ -1,6 +1,6 @@ Summary of supported commands ============ -## Documentation produced for DelegateDecompiler, version 0.32.1.0 on Tuesday, 25 October 2022 19:37 +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 This file documents what linq commands **DelegateDecompiler** supports when working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). diff --git a/test.cmd b/test.cmd index 63af1c29..7b5b5790 100644 --- a/test.cmd +++ b/test.cmd @@ -12,3 +12,4 @@ dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Entity dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests && ^ dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests && ^ dotnet test --no-build -c Release -f net6.0 src\DelegateDecompiler.EntityFrameworkCore6.Tests +dotnet test --no-build -c Release -f net8.0 src\DelegateDecompiler.EntityFrameworkCore8.Tests From 8c90b764a65494dfc91ebd8aff95b63dce2c6b72 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:15:53 +1000 Subject: [PATCH 2/8] Oops, forgot to commit files --- ...compiler.EntityFrameworkCore8.Tests.csproj | 44 + .../DetailedListOfSupportedCommands.md | 153 ++++ .../DetailedListOfSupportedCommandsWithSQL.md | 799 ++++++++++++++++++ .../DocumentationHeaderText.md | 20 + .../SummaryOfSupportedCommands.md | 62 ++ .../Test file - please ignore.txt | 1 + 6 files changed, 1079 insertions(+) create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/DelegateDecompiler.EntityFrameworkCore8.Tests.csproj create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DocumentationHeaderText.md create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md create mode 100644 src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/Test file - please ignore.txt diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/DelegateDecompiler.EntityFrameworkCore8.Tests.csproj b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/DelegateDecompiler.EntityFrameworkCore8.Tests.csproj new file mode 100644 index 00000000..d505091e --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/DelegateDecompiler.EntityFrameworkCore8.Tests.csproj @@ -0,0 +1,44 @@ + + + net8.0 + Copyright © Dave Glick 2014, Jon Smith 2014, Alexander Zaytsev 2014 - 2021 + $(DefineConstants);EF_CORE;EF_CORE3;EF_CORE5 + DelegateDecompiler.EntityFramework.Tests + + + + + + %(Name) + + + + + + %(Name) + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md new file mode 100644 index 00000000..25b7ae97 --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommands.md @@ -0,0 +1,153 @@ +Detail of supported commands +============ +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 + +This file documents what linq commands **DelegateDecompiler** supports when +working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). +EF has one of the best implementations for converting Linq `IQueryable<>` commands into database +access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests. + +This documentation was produced by compaired direct EF Linq queries against the same query implemented +as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag +on each command type tested. Tests are groups and ordered to try and make finding things +easier. + +So, if you want to use DelegateDecompiler and are not sure whether the linq command +you want to use will work then clone this project and write your own tests. +(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this). +If there is a problem then please fork the repository and add your own tests. +That will make it much easier to diagnose your issue. + +*Note: The test suite has only recently been set up and has only a handful of tests at the moment. +More will appear as we move forward.* + + +### Group: Basic Features +#### [Select](../TestGroup05BasicFeatures/Test01Select.cs): +- Supported + * Bool Equals Constant (line 34) + * Bool Equals Static Variable (line 53) + * Int Equals Constant (line 70) + * Select Property Without Computed Attribute (line 87) + * Select Method Without Computed Attribute (line 104) + * Select Abstract Member Over Tph Hierarchy (line 121) + * Select Abstract Member Over Tph Hierarchy After Restricting To Subtype (line 138) + * Select Abstract Member Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 156) + * Select Abstract Member With Condition On It Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 181) + * Select Multiple Levels Of Abstract Members Over Tph Hierarchy (line 199) + +#### [Select Async](../TestGroup05BasicFeatures/Test02SelectAsync.cs): +- Supported + * Async (line 39) + * Bool Equals Constant Async (line 75) + * Decompile Upfront Bool Equals Constant Async (line 92) + * Bool Equals Static Variable To Array Async (line 111) + * Int Equals Constant (line 128) + +#### [Equals And Not Equals](../TestGroup05BasicFeatures/Test03EqualsAndNotEquals.cs): +- Supported + * Int Equals Constant (line 32) + * Int Equals Static Variable (line 50) + * Int Equals String Length (line 67) + * Int Not Equals String Length (line 84) + +#### [Nullable](../TestGroup05BasicFeatures/Test04Nullable.cs): +- Supported + * Property Is Null (line 35) + * Bool Equals Static Variable (line 54) + * Int Equals Constant (line 71) + * Nullable Init (line 88) + * Nullable Add (line 105) + +#### [Where](../TestGroup05BasicFeatures/Test05Where.cs): +- Supported + * Where Bool Equals Constant (line 33) + * Where Bool Equals Static Variable (line 52) + * Where Int Equals Constant (line 69) + * Where Filters On Abstract Members Over Tph Hierarchy (line 86) + +#### [Single](../TestGroup05BasicFeatures/Test10Single.cs): +- Supported + * Single Int Equals Unique Value (line 40) + +#### [Single Async](../TestGroup05BasicFeatures/Test11SingleAsync.cs): +- Supported + * Single Int Equals Unique Value Async (line 46) + + +### Group: Order Take +#### [Order By](../TestGroup10OrderTake/Test01OrderBy.cs): +- Supported + * Order By Children Count (line 33) + * Order By Children Count Then By String Length (line 51) + * Where Any Children Then Order By Children Count (line 69) + +#### [Skip Take](../TestGroup10OrderTake/Test02SkipTake.cs): +- Supported + * Order By Children Count Then Take (line 33) + * Order By Children Count Then Skip And Take (line 51) + * Where Any Children Then Order By Then Skip Take (line 69) + + +### Group: Quantifier Operators +#### [Any](../TestGroup12QuantifierOperators/Test01Any.cs): +- Supported + * Any Children (line 32) + * Any Children With Filter (line 49) + +#### [All](../TestGroup12QuantifierOperators/Test02All.cs): +- Supported + * Singleton All Filter (line 32) + * All Filter On Children Int (line 49) + +#### [Contains](../TestGroup12QuantifierOperators/Test03Contains.cs): +- Supported + * String Contains Constant String With Filter (line 33) + + +### Group: Aggregation +#### [Count](../TestGroup15Aggregation/Test01Count.cs): +- Supported + * Count Children (line 33) + * Count Children With Filter (line 51) + * Count Children With Filter By Closure (line 69) + * Count Children With Filter By External Closure (line 88) + * Count Children With Filter By External Closure2 (line 108) + * Singleton Count Children With Filter (line 126) + +#### [Sum](../TestGroup15Aggregation/Test02Sum.cs): +- Supported + * Sum Count In Children Where Children Can Be None (line 53) + +#### [Count Async](../TestGroup15Aggregation/Test03CountAsync.cs): +- Supported + * Count Children Async (line 40) + * Count Children With Filter Async (line 58) + * Count Children With Filter By Closure Async (line 76) + * Count Children With Filter By External Closure Async (line 95) + * Count Children With Filter By External Closure2 Async (line 115) + * Singleton Count Children With Filter Async (line 133) + + +### Group: Types +#### [Strings](../TestGroup50Types/Test01Strings.cs): +- Supported + * Concatenate Person Not Handle Null (line 32) + * Concatenate Person Handle Null (line 49) + * Concatenate Person Handle Name Order (line 68) + * Select Generic Method Person Handle (line 85) + * Filter Generic Method Person Handle (line 99) + +#### [DateTime](../TestGroup50Types/Test05DateTime.cs): +- Supported + * DateTime Where Compare With Static Variable (line 35) + + +### Group: Additional Features +#### [Nested Expressions](../TestGroup90AdditionalFeatures/Test01NestedExpressions.cs): +- Supported + * Subquery As Context Extension Method (line 68) + + + +The End diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md new file mode 100644 index 00000000..13225adc --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DetailedListOfSupportedCommandsWithSQL.md @@ -0,0 +1,799 @@ +Detail With Sql of supported commands +============ +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 + +This file documents what linq commands **DelegateDecompiler** supports when +working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). +EF has one of the best implementations for converting Linq `IQueryable<>` commands into database +access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests. + +This documentation was produced by compaired direct EF Linq queries against the same query implemented +as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag +on each command type tested. Tests are groups and ordered to try and make finding things +easier. + +So, if you want to use DelegateDecompiler and are not sure whether the linq command +you want to use will work then clone this project and write your own tests. +(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this). +If there is a problem then please fork the repository and add your own tests. +That will make it much easier to diagnose your issue. + +*Note: The test suite has only recently been set up and has only a handful of tests at the moment. +More will appear as we move forward.* + + +### Group: Basic Features +#### [Select](../TestGroup05BasicFeatures/Test01Select.cs): +- Supported + * Bool Equals Constant (line 34) + * T-Sql executed is + +```SQL +SELECT [e].[ParentBool] +FROM [EfParents] AS [e] +``` + + * Bool Equals Static Variable (line 53) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentBool] = @__staticBool_0 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Equals Constant (line 70) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] = 123 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Select Property Without Computed Attribute (line 87) + * T-Sql executed is + +```SQL +SELECT [e].[FirstName] + N' ' + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +FROM [EfPersons] AS [e] +``` + + * Select Method Without Computed Attribute (line 104) + * T-Sql executed is + +```SQL +SELECT [e].[FirstName] + N' ' + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +FROM [EfPersons] AS [e] +``` + + * Select Abstract Member Over Tph Hierarchy (line 121) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [l].[Discriminator] = N'Person' THEN N'Human' + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Carcharodon carcharias' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Gadus morhua' + WHEN [l].[Discriminator] = N'HoneyBee' THEN N'Apis mellifera' + WHEN [l].[Discriminator] = N'Dog' THEN N'Canis lupus' + ELSE NULL +END +FROM [LivingBeeing] AS [l] +``` + + * Select Abstract Member Over Tph Hierarchy After Restricting To Subtype (line 138) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [l].[Discriminator] = N'HoneyBee' THEN N'Apis mellifera' + WHEN [l].[Discriminator] = N'Dog' THEN N'Canis lupus' + ELSE NULL +END +FROM [LivingBeeing] AS [l] +WHERE [l].[Discriminator] IN (N'Dog', N'HoneyBee') +``` + + * Select Abstract Member Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 156) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Carcharodon carcharias' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Gadus morhua' + ELSE NULL +END AS [Species], CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Fish' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Fish' + ELSE NULL +END AS [Group] +FROM [LivingBeeing] AS [l] +WHERE [l].[Discriminator] IN (N'AtlanticCod', N'WhiteShark') +``` + + * Select Abstract Member With Condition On It Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 181) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Carcharodon carcharias' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Gadus morhua' + ELSE NULL +END AS [Species], CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Fish' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Fish' + ELSE NULL +END AS [Group] +FROM [LivingBeeing] AS [l] +WHERE [l].[Discriminator] IN (N'AtlanticCod', N'WhiteShark') AND CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Carcharodon carcharias' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Gadus morhua' + ELSE NULL +END IS NOT NULL AND CASE + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Fish' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Fish' + ELSE NULL +END IS NOT NULL +``` + + * Select Multiple Levels Of Abstract Members Over Tph Hierarchy (line 199) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [l].[Discriminator] = N'HoneyBee' THEN N'Apis mellifera' + WHEN [l].[Discriminator] = N'Dog' THEN N'Canis lupus' + ELSE NULL +END, CASE + WHEN [l].[Discriminator] = N'HoneyBee' THEN CAST(0 AS bit) + ELSE CASE + WHEN [l].[Discriminator] = N'Dog' THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) + END +END +FROM [LivingBeeing] AS [l] +WHERE [l].[Discriminator] IN (N'Dog', N'HoneyBee') +``` + + +#### [Select Async](../TestGroup05BasicFeatures/Test02SelectAsync.cs): +- Supported + * Async (line 39) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId], [e].[EndDate], [e].[ParentBool], [e].[ParentDouble], [e].[ParentInt], [e].[ParentNullableDecimal1], [e].[ParentNullableDecimal2], [e].[ParentNullableInt], [e].[ParentString], [e].[ParentTimeSpan], [e].[StartDate] +FROM [EfParents] AS [e] +``` + + * Bool Equals Constant Async (line 75) + * T-Sql executed is + +```SQL +SELECT [e].[ParentBool] +FROM [EfParents] AS [e] +``` + + * Decompile Upfront Bool Equals Constant Async (line 92) + * T-Sql executed is + +```SQL +SELECT [e].[ParentBool] +FROM [EfParents] AS [e] +``` + + * Bool Equals Static Variable To Array Async (line 111) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentBool] = @__staticBool_0 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Equals Constant (line 128) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] = 123 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + +#### [Equals And Not Equals](../TestGroup05BasicFeatures/Test03EqualsAndNotEquals.cs): +- Supported + * Int Equals Constant (line 32) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] = 123 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Equals Static Variable (line 50) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] = @__staticInt_0 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Equals String Length (line 67) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] = CAST(LEN([e].[ParentString]) AS int) AND [e].[ParentString] IS NOT NULL THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Not Equals String Length (line 84) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentInt] <> CAST(LEN([e].[ParentString]) AS int) OR [e].[ParentString] IS NULL THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + +#### [Nullable](../TestGroup05BasicFeatures/Test04Nullable.cs): +- Supported + * Property Is Null (line 35) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentNullableInt] IS NULL THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Bool Equals Static Variable (line 54) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentNullableInt] IS NULL THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Int Equals Constant (line 71) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[ParentNullableInt] = 123 AND [e].[ParentNullableInt] IS NOT NULL THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Nullable Init (line 88) + * T-Sql executed is + +```SQL +SELECT NULL +FROM [EfParents] AS [e] +``` + + * Nullable Add (line 105) + * T-Sql executed is + +```SQL +SELECT [e].[ParentNullableDecimal1] + [e].[ParentNullableDecimal2] +FROM [EfParents] AS [e] +``` + + +#### [Where](../TestGroup05BasicFeatures/Test05Where.cs): +- Supported + * Where Bool Equals Constant (line 33) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +WHERE [e].[ParentBool] = CAST(1 AS bit) +``` + + * Where Bool Equals Static Variable (line 52) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +WHERE [e].[ParentBool] = @__staticBool_0 +``` + + * Where Int Equals Constant (line 69) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +WHERE [e].[ParentInt] = 123 +``` + + * Where Filters On Abstract Members Over Tph Hierarchy (line 86) + * T-Sql executed is + +```SQL +SELECT [l].[Id] +FROM [LivingBeeing] AS [l] +WHERE CASE + WHEN [l].[Discriminator] = N'Person' THEN N'Human' + WHEN [l].[Discriminator] = N'WhiteShark' THEN N'Carcharodon carcharias' + WHEN [l].[Discriminator] = N'AtlanticCod' THEN N'Gadus morhua' + WHEN [l].[Discriminator] = N'HoneyBee' THEN N'Apis mellifera' + WHEN [l].[Discriminator] = N'Dog' THEN N'Canis lupus' + ELSE NULL +END = N'Human' +``` + + +#### [Single](../TestGroup05BasicFeatures/Test10Single.cs): +- Supported + * Single Int Equals Unique Value (line 40) + * T-Sql executed is + +```SQL +SELECT TOP(2) [e].[EfParentId], CASE + WHEN [e].[ParentInt] = 987 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END AS [IntEqualsUniqueValue] +FROM [EfParents] AS [e] +WHERE [e].[ParentInt] = 987 +``` + + +#### [Single Async](../TestGroup05BasicFeatures/Test11SingleAsync.cs): +- Supported + * Single Int Equals Unique Value Async (line 46) + * T-Sql executed is + +```SQL +SELECT TOP(2) [e].[EfParentId], CASE + WHEN [e].[ParentInt] = 987 THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END AS [IntEqualsUniqueValue] +FROM [EfParents] AS [e] +WHERE [e].[ParentInt] = 987 +``` + + + +### Group: Order Take +#### [Order By](../TestGroup10OrderTake/Test01OrderBy.cs): +- Supported + * Order By Children Count (line 33) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +``` + + * Order By Children Count Then By String Length (line 51) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]), CAST(LEN([e].[ParentString]) AS int) +``` + + * Where Any Children Then Order By Children Count (line 69) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +WHERE EXISTS ( + SELECT 1 + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e1] + WHERE [e].[EfParentId] = [e1].[EfParentId]) +``` + + +#### [Skip Take](../TestGroup10OrderTake/Test02SkipTake.cs): +- Supported + * Order By Children Count Then Take (line 33) + * T-Sql executed is + +```SQL +SELECT TOP(@__p_0) [e].[EfParentId] +FROM [EfParents] AS [e] +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +``` + + * Order By Children Count Then Skip And Take (line 51) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY +``` + + * Where Any Children Then Order By Then Skip Take (line 69) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] +FROM [EfParents] AS [e] +WHERE EXISTS ( + SELECT 1 + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +ORDER BY ( + SELECT COUNT(*) + FROM [EfChildren] AS [e1] + WHERE [e].[EfParentId] = [e1].[EfParentId]) +OFFSET @__p_0 ROWS FETCH NEXT @__p_0 ROWS ONLY +``` + + + +### Group: Quantifier Operators +#### [Any](../TestGroup12QuantifierOperators/Test01Any.cs): +- Supported + * Any Children (line 32) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + * Any Children With Filter (line 49) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = 123) THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + +#### [All](../TestGroup12QuantifierOperators/Test02All.cs): +- Supported + * Singleton All Filter (line 32) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN NOT EXISTS ( + SELECT 1 + FROM [EfParents] AS [e] + WHERE [e].[ParentInt] <> 123) THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +``` + + * All Filter On Children Int (line 49) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN NOT EXISTS ( + SELECT 1 + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] <> 123) THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END +FROM [EfParents] AS [e] +``` + + +#### [Contains](../TestGroup12QuantifierOperators/Test03Contains.cs): +- Supported + * String Contains Constant String With Filter (line 33) + * T-Sql executed is + +```SQL +SELECT [e].[ParentString] +FROM [EfParents] AS [e] +WHERE [e].[ParentString] LIKE N'%2%' +``` + + + +### Group: Aggregation +#### [Count](../TestGroup15Aggregation/Test01Count.cs): +- Supported + * Count Children (line 33) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter (line 51) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = 123) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By Closure (line 69) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = [e].[ParentInt]) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By External Closure (line 88) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = @__i_0) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By External Closure2 (line 108) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = @__i_0 AND [e0].[EfParentId] = @__j_1) +FROM [EfParents] AS [e] +``` + + * Singleton Count Children With Filter (line 126) + * T-Sql executed is + +```SQL +SELECT COUNT(*) +FROM [EfParents] AS [e] +WHERE ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) = 2 +``` + + +#### [Sum](../TestGroup15Aggregation/Test02Sum.cs): +- Supported + * Sum Count In Children Where Children Can Be None (line 53) + * T-Sql executed is + +```SQL +SELECT COALESCE(( + SELECT COALESCE(SUM([e0].[ChildInt]), 0) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]), 0) +FROM [EfParents] AS [e] +``` + + +#### [Count Async](../TestGroup15Aggregation/Test03CountAsync.cs): +- Supported + * Count Children Async (line 40) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter Async (line 58) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = 123) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By Closure Async (line 76) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = [e].[ParentInt]) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By External Closure Async (line 95) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = @__i_0) +FROM [EfParents] AS [e] +``` + + * Count Children With Filter By External Closure2 Async (line 115) + * T-Sql executed is + +```SQL +SELECT ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId] AND [e0].[ChildInt] = @__i_0 AND [e0].[EfParentId] = @__j_1) +FROM [EfParents] AS [e] +``` + + * Singleton Count Children With Filter Async (line 133) + * T-Sql executed is + +```SQL +SELECT COUNT(*) +FROM [EfParents] AS [e] +WHERE ( + SELECT COUNT(*) + FROM [EfChildren] AS [e0] + WHERE [e].[EfParentId] = [e0].[EfParentId]) = 2 +``` + + + +### Group: Types +#### [Strings](../TestGroup50Types/Test01Strings.cs): +- Supported + * Concatenate Person Not Handle Null (line 32) + * T-Sql executed is + +```SQL +SELECT [e].[FirstName] + N' ' + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +FROM [EfPersons] AS [e] +``` + + * Concatenate Person Handle Null (line 49) + * T-Sql executed is + +```SQL +SELECT [e].[FirstName] + CASE + WHEN [e].[MiddleName] IS NULL THEN N'' + ELSE N' ' +END + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +FROM [EfPersons] AS [e] +``` + + * Concatenate Person Handle Name Order (line 68) + * T-Sql executed is + +```SQL +SELECT CASE + WHEN [e].[NameOrder] = CAST(1 AS bit) THEN [e].[LastName] + N', ' + [e].[FirstName] + CASE + WHEN [e].[MiddleName] IS NULL THEN N'' + ELSE N' ' + END + ELSE [e].[FirstName] + CASE + WHEN [e].[MiddleName] IS NULL THEN N'' + ELSE N' ' + END + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +END +FROM [EfPersons] AS [e] +``` + + * Select Generic Method Person Handle (line 85) + * T-Sql executed is + +```SQL +SELECT [e].[FirstName] + CASE + WHEN [e].[MiddleName] IS NULL THEN N'' + ELSE N' ' +END + COALESCE([e].[MiddleName], N'') + N' ' + [e].[LastName] +FROM [EfPersons] AS [e] +``` + + * Filter Generic Method Person Handle (line 99) + * T-Sql executed is + +```SQL +SELECT [e].[EfPersonId], [e].[FirstName], [e].[LastName], [e].[MiddleName], [e].[NameOrder] +FROM [EfPersons] AS [e] +``` + + +#### [DateTime](../TestGroup50Types/Test05DateTime.cs): +- Supported + * DateTime Where Compare With Static Variable (line 35) + * T-Sql executed is + +```SQL +SELECT [e].[StartDate] +FROM [EfParents] AS [e] +WHERE [e].[StartDate] > '2000-01-01T00:00:00.0000000' +``` + + + +### Group: Additional Features +#### [Nested Expressions](../TestGroup90AdditionalFeatures/Test01NestedExpressions.cs): +- Supported + * Subquery As Context Extension Method (line 68) + * T-Sql executed is + +```SQL +SELECT [e].[EfParentId] AS [ParentId], COALESCE(( + SELECT TOP(1) [e0].[EfChildId] + FROM [EfChildren] AS [e0] + WHERE [e0].[EfParentId] = [e].[EfParentId]), 0) AS [FirstChildId] +FROM [EfParents] AS [e] +``` + + + + +The End diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DocumentationHeaderText.md b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DocumentationHeaderText.md new file mode 100644 index 00000000..3a89a85d --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/DocumentationHeaderText.md @@ -0,0 +1,20 @@ + +This file documents what linq commands **DelegateDecompiler** supports when +working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). +EF has one of the best implementations for converting Linq `IQueryable<>` commands into database +access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests. + +This documentation was produced by compaired direct EF Linq queries against the same query implemented +as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag +on each command type tested. Tests are groups and ordered to try and make finding things +easier. + +So, if you want to use DelegateDecompiler and are not sure whether the linq command +you want to use will work then clone this project and write your own tests. +(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this). +If there is a problem then please fork the repository and add your own tests. +That will make it much easier to diagnose your issue. + +*Note: The test suite has only recently been set up and has only a handful of tests at the moment. +More will appear as we move forward.* + diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md new file mode 100644 index 00000000..56ec9cc0 --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/SummaryOfSupportedCommands.md @@ -0,0 +1,62 @@ +Summary of supported commands +============ +## Documentation produced for DelegateDecompiler, version 0.33.0.0 on Thursday, 02 May 2024 21:08 + +This file documents what linq commands **DelegateDecompiler** supports when +working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF). +EF has one of the best implementations for converting Linq `IQueryable<>` commands into database +access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests. + +This documentation was produced by compaired direct EF Linq queries against the same query implemented +as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag +on each command type tested. Tests are groups and ordered to try and make finding things +easier. + +So, if you want to use DelegateDecompiler and are not sure whether the linq command +you want to use will work then clone this project and write your own tests. +(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this). +If there is a problem then please fork the repository and add your own tests. +That will make it much easier to diagnose your issue. + +*Note: The test suite has only recently been set up and has only a handful of tests at the moment. +More will appear as we move forward.* + + +### Group: Basic Features +- Supported + * [Select](../TestGroup05BasicFeatures/Test01Select.cs) (10 tests) + * [Select Async](../TestGroup05BasicFeatures/Test02SelectAsync.cs) (5 tests) + * [Equals And Not Equals](../TestGroup05BasicFeatures/Test03EqualsAndNotEquals.cs) (4 tests) + * [Nullable](../TestGroup05BasicFeatures/Test04Nullable.cs) (5 tests) + * [Where](../TestGroup05BasicFeatures/Test05Where.cs) (4 tests) + * [Single](../TestGroup05BasicFeatures/Test10Single.cs) (1 tests) + * [Single Async](../TestGroup05BasicFeatures/Test11SingleAsync.cs) (1 tests) + +### Group: Order Take +- Supported + * [Order By](../TestGroup10OrderTake/Test01OrderBy.cs) (3 tests) + * [Skip Take](../TestGroup10OrderTake/Test02SkipTake.cs) (3 tests) + +### Group: Quantifier Operators +- Supported + * [Any](../TestGroup12QuantifierOperators/Test01Any.cs) (2 tests) + * [All](../TestGroup12QuantifierOperators/Test02All.cs) (2 tests) + * [Contains](../TestGroup12QuantifierOperators/Test03Contains.cs) (1 tests) + +### Group: Aggregation +- Supported + * [Count](../TestGroup15Aggregation/Test01Count.cs) (6 tests) + * [Sum](../TestGroup15Aggregation/Test02Sum.cs) (1 tests) + * [Count Async](../TestGroup15Aggregation/Test03CountAsync.cs) (6 tests) + +### Group: Types +- Supported + * [Strings](../TestGroup50Types/Test01Strings.cs) (5 tests) + * [DateTime](../TestGroup50Types/Test05DateTime.cs) (1 tests) + +### Group: Additional Features +- Supported + * [Nested Expressions](../TestGroup90AdditionalFeatures/Test01NestedExpressions.cs) (1 tests) + + +The End diff --git a/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/Test file - please ignore.txt b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/Test file - please ignore.txt new file mode 100644 index 00000000..875c32fa --- /dev/null +++ b/src/DelegateDecompiler.EntityFrameworkCore8.Tests/GeneratedDocumentation/Test file - please ignore.txt @@ -0,0 +1 @@ +This is a Unit Test of the MarkupFileHelpers \ No newline at end of file From 193f77240662f790dff35a74523a2bdf8323ce24 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:22:38 +1000 Subject: [PATCH 3/8] Update connection string --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 4bc290d1..973cf570 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ before_test: - ps: >- $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2017;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True"; + $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2017;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True;TrustServerCertificate=True"; $doc.Save($config); artifacts: From 05d49d3a7401c72633d5bf8f3ce801d5a3bd5c63 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:29:37 +1000 Subject: [PATCH 4/8] Switch to SQL2019 --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 973cf570..d2d9f05c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,8 @@ environment: DOTNET_CLI_TELEMETRY_OPTOUT: true IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1 -services: - - mssql2017 +init: + - net start MSSQL$SQL2019 build_script: - build.cmd @@ -23,7 +23,7 @@ before_test: - ps: >- $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2017;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True;TrustServerCertificate=True"; + $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True"; $doc.Save($config); artifacts: From 6e945d96e5f5e9ec8bec73985734be8c8e5c2f8f Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:43:57 +1000 Subject: [PATCH 5/8] Try trusting connection again --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d2d9f05c..ee303751 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ before_test: - ps: >- $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True"; + $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True;TrustServerCertificate=True"; $doc.Save($config); artifacts: From acfeb28ae6188ac181d8965c7a7d9b677fb5b59c Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 21:57:42 +1000 Subject: [PATCH 6/8] Do not encrypt --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ee303751..785f3294 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ before_test: - ps: >- $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True;TrustServerCertificate=True"; + $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Encrypt=False"; $doc.Save($config); artifacts: From 0544f12c6f4a082776c17b60f515019c002ad267 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 22:06:17 +1000 Subject: [PATCH 7/8] Try this :-/ --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 785f3294..f9240b3a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ before_test: - ps: >- $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Encrypt=False"; + $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Encrypt=False;TrustServerCertificate=True;"; $doc.Save($config); artifacts: From 34191b68713e1ed42f203ce3c2fcdb1158e167eb Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 2 May 2024 22:13:29 +1000 Subject: [PATCH 8/8] Try this --- appveyor.yml | 8 -------- src/DelegateDecompiler.EntityFramework.Tests/App.config | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f9240b3a..f936a5ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,14 +18,6 @@ before_build: test_script: - test.cmd -# replace the db connection with the local instance : -before_test: -- ps: >- - $config = join-path (Resolve-Path .\).Path '.\src\DelegateDecompiler.EntityFramework.Tests\App.config'; - $doc = (gc $config) -as [xml]; - $doc.SelectSingleNode('//connectionStrings/add[@name="DelegateDecompilerEfTestDb"]').connectionString = "Server=(local)\\SQL2019;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Encrypt=False;TrustServerCertificate=True;"; - $doc.Save($config); - artifacts: - path: '**/*.nupkg' - path: '**/*.snupkg' diff --git a/src/DelegateDecompiler.EntityFramework.Tests/App.config b/src/DelegateDecompiler.EntityFramework.Tests/App.config index 2e5a639f..8adbafa4 100644 --- a/src/DelegateDecompiler.EntityFramework.Tests/App.config +++ b/src/DelegateDecompiler.EntityFramework.Tests/App.config @@ -15,6 +15,6 @@ - +