efcore / EFCore.FSharp

Adds F# design-time support to EF Core
MIT License
234 stars 26 forks source link

[Option] Optional DateTime properties cannot be filtered #141

Closed xperiandri closed 2 years ago

xperiandri commented 2 years ago

Describe the bug u.SubscriptionEndDate.Value > DateTime.UtcNow cannot be translated

let now = DateTime.UcNow
u.SubscriptionEndDate > Some now

System.InvalidOperationException: 'The binary operator GreaterThan is not defined for the types 'Microsoft.FSharp.Core.FSharpOption`1[System.DateTime]' and 'Microsoft.FSharp.Core.FSharpOption`1[System.DateTime]'.'

Version 6.0.7

xperiandri commented 2 years ago

Missing .UseFSharpTypes() according to https://efcore.github.io/EFCore.FSharp//How_Tos/Use_DbContextHelpers.html was the issue