Temporal rewriter may have issue
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
Exception -
```
System.InvalidOperationException : An exception was thrown while attempting to evaluate the LINQ query parameter expression 'Convert(value(Microsoft.EntityFrameworkCore.Query.ComplexNavigationsCollectionsQueryTestBase`1+<>c__DisplayClass25_0[Microsoft.EntityFrameworkCore.Query.TemporalComplexNavigationsSharedTypeQuerySqlServerFixture]).ss.Set(), DbSet`1).TemporalAsOf(1/1/2010 12:00:00 AM)'. See the inner exception for more information.
---- System.InvalidCastException : Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.ComplexNavigationsModel.Level2]' to type 'Microsoft.EntityFrameworkCore.DbSet`1[Microsoft.EntityFrameworkCore.TestModels.ComplexNavigationsModel.Level2]'.
```
Query
```
DbSet()
.OrderBy(l1 => l1.Id)
.Select(l1 => new {
l1 = l1,
inner = <>c__DisplayClass25_0.ss.Set()
.Where(l2 => l2.Name != "Foo")
.Select(l2 => new {
l2 = l2,
innerL1s = <>c__DisplayClass25_0.ss.Set()
.Where(innerL1 => innerL1.OneToMany_Optional1
.Any(innerL2 => innerL2.Id == l2.Id))
.Select(innerL1 => innerL1.Name)
.AsEnumerable()
})
.Select(<>h__TransparentIdentifier0 => <>h__TransparentIdentifier0.innerL1s
.ToList())
.FirstOrDefault()
})
.Select(<>h__TransparentIdentifier0 => <>h__TransparentIdentifier0.inner
.ToList())
```
We are adding convert to DbSet in rewriter for test and it is throwing something off.
Only happens for STET so may be because Set is never db set.
Contributor guide
Assessment
This issue has not been assessed yet.