Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DelegateDecompiler.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion DelegateDecompiler.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
12 changes: 2 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)\\SQL2017;Database=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;User ID=sa;Password=Password12!;Trusted_connection=True";
$doc.Save($config);

artifacts:
- path: '**/*.nupkg'
- path: '**/*.snupkg'
Expand Down
2 changes: 1 addition & 1 deletion src/DelegateDecompiler.EntityFramework.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
</providers>
</entityFramework>
<connectionStrings>
<add name="DelegateDecompilerEfTestDb" connectionString="Data Source=.;Initial Catalog=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;Trusted_Connection=True" providerName="System.Data.SqlClient" />
<add name="DelegateDecompilerEfTestDb" connectionString="Data Source=.;Initial Catalog=DelegateDecompilerEfTestDb;MultipleActiveResultSets=True;Trusted_Connection=True;TrustServerCertificate=True" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Copyright>Copyright © Dave Glick 2014, Jon Smith 2014, Alexander Zaytsev 2014 - 2021</Copyright>
<DefineConstants>$(DefineConstants);EF_CORE;EF_CORE3;EF_CORE5</DefineConstants>
<RootNamespace>DelegateDecompiler.EntityFramework.Tests</RootNamespace>
</PropertyGroup>


<ItemGroup>
<Compile Include="..\DelegateDecompiler.EntityFramework.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFramework.Tests\obj\**">
<Link>%(Name)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Include="..\DelegateDecompiler.EntityFrameworkCore.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFrameworkCore.Tests\obj\**">
<Link>%(Name)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Remove="..\DelegateDecompiler.EntityFramework.Tests\EntityTypeConfigurationExtensionsTests.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\DelegateDecompiler.EntityFramework.Tests\App.config" Link="App.config" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DelegateDecompiler.EntityFrameworkCore5\DelegateDecompiler.EntityFrameworkCore5.csproj" />
<ProjectReference Include="..\DelegateDecompiler.Tests\DelegateDecompiler.Tests.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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
Loading