Skip to content

Commit

Permalink
Add support filtering in the nested collections - version 2.0.0-beta.1 (
Browse files Browse the repository at this point in the history
#15)

* fix nullable warnings

* change SyntaxTree folder name to Syntax

* update folder structures

* remove unused usings

* change constructor parameter orders

* remove unused usings

* fix comment fop

* add infrastructure to support nested collections

* Add support filtering in the nested collections fixed #13 #10

* Ready to release 2.0.0-beta.1

* add nested collection sample
  • Loading branch information
alirezanet authored Sep 15, 2021
1 parent 98404a0 commit 66fcd2a
Show file tree
Hide file tree
Showing 49 changed files with 543 additions and 297 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,20 @@ eg:
var gm = new GridifyMapper<Person>()
.AddMap("name" , q => q.FullName , v => v.ToLower() )
```


---

## Filtering on Nested Collections
You can use LINQ `Select` and `SelectMany` methods to filter your data using its nested collections.

In this example, we have 3 nested collections, but filtering will apply to the `Property1` of the third level.
```c#
var gm = new GridifyMapper<Level1>()
.AddMap("prop1", l1 => l1.Level2List.SelectMany(l2 => l2.Level3List).Select(l3 => l3.Property1);
```

if you have only two-level nesting, you don't need to use `SelectMany`.

---

## EntityFramework integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Benchmarks</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Core\Gridify.csproj" />
<ProjectReference Include="..\src\Gridify\Gridify.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void Gridify()
[Benchmark]
public void Fop()
{
// for doesn't have filtering only feature
// fop doesn't have filtering only feature
Ds.ApplyFop(FopExpressionBuilder<TestClass>.Build("Name~=a", "Name", 1, 1000)).Item1.Consume(Consumer);
Ds.ApplyFop(FopExpressionBuilder<TestClass>.Build("Id>5", "Name", 1, 1000)).Item1.Consume(Consumer);
Ds.ApplyFop(FopExpressionBuilder<TestClass>.Build("Name==Ali", "Name", 1, 1000)).Item1.Consume(Consumer);
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions githubpush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dotnet build -c Release

mv nuget.config0 nuget.config

dotnet nuget push "./src/EntityFramework/bin/Release/Gridify.EntityFramewor.1.3.3.nupkg" --source "github"
dotnet nuget push "./src/EntityFramework5/bin/Release/Gridify.EntityFramework5.1.3.3.nupkg" --source "github"
dotnet nuget push "./src/Core/bin/Release/Gridify.1.3.3.nupkg" --source "github"
dotnet nuget push "./src/Gridify.EntityFramework/bin/Release/Gridify.EntityFramewor.1.3.3.nupkg" --source "github"
dotnet nuget push "./src/Gridify/bin/Release/Gridify.1.3.3.nupkg" --source "github"
mv nuget.config nuget.config0
120 changes: 61 additions & 59 deletions gridify.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0FCD2937-1953-465E-8608-42B8EB8757C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gridify", "src\Core\Gridify.csproj", "{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gridify.EntityFramework", "src\EntityFramework\Gridify.EntityFramework.csproj", "{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkIntegrationTests.cs", "test\EntityFrameworkIntegrationTests.cs\EntityFrameworkIntegrationTests.cs.csproj", "{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework6IntegrationTests.cs", "test\EntityFramework6IntegrationTests.cs\EntityFramework6IntegrationTests.cs.csproj", "{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Tests", "test\Core.Tests\Core.Tests.csproj", "{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gridify", "src\Gridify\Gridify.csproj", "{833CCD80-4261-405A-8A4A-BD9B3C375496}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkIntegrationTests.cs", "test\EntityFrameworkIntegrationTests.cs\EntityFrameworkIntegrationTests.cs.csproj", "{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gridify.EntityFramework", "src\Gridify.EntityFramework\Gridify.EntityFramework.csproj", "{D1296959-F923-44B6-A8F9-967D5FB7C4C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "src\Benchmarks\Benchmarks.csproj", "{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{41676937-4F05-4794-A2E5-442127927776}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework6IntegrationTests.cs", "test\EntityFramework6IntegrationTests.cs\EntityFramework6IntegrationTests.cs.csproj", "{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gridify.Tests", "test\Gridify.Tests\Gridify.Tests.csproj", "{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "benchmark\Benchmark.csproj", "{02F96021-6989-4F09-919D-999F0BE3DEFB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -32,42 +34,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|x64.ActiveCfg = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|x64.Build.0 = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|x86.ActiveCfg = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Debug|x86.Build.0 = Debug|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|Any CPU.Build.0 = Release|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|x64.ActiveCfg = Release|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|x64.Build.0 = Release|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|x86.ActiveCfg = Release|Any CPU
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E}.Release|x86.Build.0 = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|x64.ActiveCfg = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|x64.Build.0 = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Debug|x86.Build.0 = Debug|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|Any CPU.Build.0 = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|x64.ActiveCfg = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|x64.Build.0 = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|x86.ActiveCfg = Release|Any CPU
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2}.Release|x86.Build.0 = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|x64.ActiveCfg = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|x64.Build.0 = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|x86.ActiveCfg = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Debug|x86.Build.0 = Debug|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|Any CPU.Build.0 = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|x64.ActiveCfg = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|x64.Build.0 = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|x86.ActiveCfg = Release|Any CPU
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27}.Release|x86.Build.0 = Release|Any CPU
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -80,32 +46,68 @@ Global
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Release|x64.Build.0 = Release|Any CPU
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Release|x86.ActiveCfg = Release|Any CPU
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296}.Release|x86.Build.0 = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|x64.ActiveCfg = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|x64.Build.0 = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|x86.ActiveCfg = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Debug|x86.Build.0 = Debug|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|Any CPU.Build.0 = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|x64.ActiveCfg = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|x64.Build.0 = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|x86.ActiveCfg = Release|Any CPU
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D}.Release|x86.Build.0 = Release|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Debug|x64.ActiveCfg = Debug|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Debug|x86.ActiveCfg = Debug|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Release|x64.ActiveCfg = Release|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Release|x86.ActiveCfg = Release|Any CPU
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|Any CPU.Build.0 = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|x64.ActiveCfg = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|x64.Build.0 = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|x86.ActiveCfg = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Debug|x86.Build.0 = Debug|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|Any CPU.ActiveCfg = Release|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|Any CPU.Build.0 = Release|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|x64.ActiveCfg = Release|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|x64.Build.0 = Release|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|x86.ActiveCfg = Release|Any CPU
{833CCD80-4261-405A-8A4A-BD9B3C375496}.Release|x86.Build.0 = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|x64.ActiveCfg = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|x64.Build.0 = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|x86.ActiveCfg = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Debug|x86.Build.0 = Debug|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|Any CPU.Build.0 = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|x64.ActiveCfg = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|x64.Build.0 = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|x86.ActiveCfg = Release|Any CPU
{D1296959-F923-44B6-A8F9-967D5FB7C4C1}.Release|x86.Build.0 = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|x64.ActiveCfg = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|x64.Build.0 = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|x86.ActiveCfg = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Debug|x86.Build.0 = Debug|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|Any CPU.Build.0 = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|x64.ActiveCfg = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|x64.Build.0 = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|x86.ActiveCfg = Release|Any CPU
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE}.Release|x86.Build.0 = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|x64.ActiveCfg = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|x64.Build.0 = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|x86.ActiveCfg = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Debug|x86.Build.0 = Debug|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|Any CPU.Build.0 = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|x64.ActiveCfg = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|x64.Build.0 = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|x86.ActiveCfg = Release|Any CPU
{02F96021-6989-4F09-919D-999F0BE3DEFB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DBD6F424-B54C-47C5-9B1D-9E74B55D323E} = {0FCD2937-1953-465E-8608-42B8EB8757C7}
{DC20C025-1F2D-45FF-86ED-D9F72E2E04B2} = {0FCD2937-1953-465E-8608-42B8EB8757C7}
{1A0C8C17-D4AD-4827-9857-36E9C0A8BB27} = {1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}
{73CD6D56-C43D-4460-AFFA-FC1AEFB06296} = {1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}
{D3652CB7-1CC5-4142-8559-16D6F40FBD0D} = {0FCD2937-1953-465E-8608-42B8EB8757C7}
{CDFDBB16-1D9F-40FD-B693-96D1D4FB79EE} = {1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}
{833CCD80-4261-405A-8A4A-BD9B3C375496} = {0FCD2937-1953-465E-8608-42B8EB8757C7}
{D1296959-F923-44B6-A8F9-967D5FB7C4C1} = {0FCD2937-1953-465E-8608-42B8EB8757C7}
{6CCEB3F3-2A8A-4790-8DB7-C912509ADFDE} = {1BBCBA37-25E5-4BFF-A8E8-7EE582E0317F}
{02F96021-6989-4F09-919D-999F0BE3DEFB} = {41676937-4F05-4794-A2E5-442127927776}
EndGlobalSection
EndGlobal
12 changes: 0 additions & 12 deletions src/Core/IGMap.cs

This file was deleted.

Loading

0 comments on commit 66fcd2a

Please sign in to comment.