Cosmos: TimeOnly arithmetic is translated incorrectly
Open
area-cosmos
area-query
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
The following test:
```c#
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task TimeOnly_subtract_TimeOnly(bool async)
=> AssertQuery(
async,
ss => ss.Set().Where(b => b.TimeOnly - new TimeOnly(10, 0, 0) == new TimeSpan(0, 0, 15, 50, 500)));
```
... generates the following SQL:
```sql
SELECT VALUE c
FROM root c
WHERE ((c["TimeOnly"] - "10:00:00") = "00:15:50.5000000")
```
We should either correct the translation or block it. Check arithmetic over other temporal types to make sure we're doing the right thing.
Contributor guide
Assessment
This issue has not been assessed yet.