Skip to content

Commit

Permalink
Added Unnest test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanyliv committed Apr 7, 2022
1 parent 8a63535 commit 96a32f8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/NpgSqlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,23 @@ where Sql.Ext.PostgreSQL().Overlaps(m.Guids, guids)
}
}

[Test]
public void TestUnnest()
{
using var db = CreateNpgSqlEntitiesContext();
using var dc = db.CreateLinqToDbConnection();

var guids = new Guid[] { Guid.Parse("271425b1-ebe8-400d-b71d-a6e47a460ae3"),
Guid.Parse("b75de94e-6d7b-4c70-bfa1-f8639a6a5b35") };

var query =
from m in db.EntityWithArrays.ToLinqToDBTable()
from g in dc.Unnest(m.Guids)
where Sql.Ext.PostgreSQL().Overlaps(m.Guids, guids)
select m;

query.Invoking(q => q.ToArray()).Should().NotThrow();
}

}
}

0 comments on commit 96a32f8

Please sign in to comment.