Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 1a21572

Browse files
committed
Change JoinAliasTest to use CustomJoin
1 parent 1d94f66 commit 1a21572

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/ServiceStack.OrmLite.Tests/Expression/JoinAliasTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ public void Can_use_JoinAlias_in_condition()
3131
var fromDateTime = new DateTime(2000, 02, 02);
3232

3333
var q = db.From<Task>()
34-
.LeftJoin<Task>((parent, history) => parent.Id == history.ParentId, db.JoinAlias("history"))
34+
.CustomJoin("LEFT JOIN Task history ON (Task.Id = history.ParentId)")
3535
.Where("history.\"Created\" >= {0} OR Task.\"Created\" >= {0}", fromDateTime);
3636

37-
//TODO: JOIN Alias doesn't support self-joins
37+
//doesn't work with Self Joins
38+
//var q = db.From<Task>()
39+
// .LeftJoin<Task, Task>((parent, history) => (parent.Id == history.ParentId)
40+
// && (history.CreatedAt >= fromDateTime || parent.CreatedAt >= fromDateTime)
41+
// ,db.JoinAlias("history"));
3842

3943
var results = db.Select(q);
4044

0 commit comments

Comments
 (0)