-
-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for n:m projections in DataLoader. (#7577)
- Loading branch information
1 parent
c964eb5
commit f5fc2f1
Showing
7 changed files
with
196 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace GreenDonut.Projections; | ||
|
||
/// <summary> | ||
/// This class is a helper that is used to project a key value pair. | ||
/// </summary> | ||
public sealed class KeyValueResult<TKey, TValue> | ||
{ | ||
public TKey Key { get; set; } = default!; | ||
|
||
public TValue Value { get; set; } = default!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
..._snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Project_Key_To_Collection_Expression | ||
|
||
```text | ||
-- @__keys_0={ '1' } (DbType = Object) | ||
SELECT b."Id", p."Name", p."Id" | ||
FROM "Brands" AS b | ||
LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" | ||
WHERE b."Id" = ANY (@__keys_0) | ||
ORDER BY b."Id" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters