You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Zaid-Ajaj
Nullable DateTime is throwing when trying to read from the database. When inserting the value in the database, the JToken used is StartObject, but when reading it expects DateTime, that throws an exception.
These are the test cases:
testCase "Documents with Nullable DateTime != null can be used" <| fun _ ->
useDatabase mapper<| fun db ->
let docs = db.GetCollection<RecNullableDateTime>()
let date = Nullable DateTime.MinValue
docs.Insert ({ Id = 1; Date = date }) |> ignore
docs.FindAll()
|> Seq.tryHead
|> function
| None -> fail()
| Some doc ->
match doc.Id, doc.Date with
| 1, date -> pass()
| _ -> fail()
testCase "Documents with Nullable DateTime = null can be used" <| fun _ ->
useDatabase mapper<| fun db ->
let docs = db.GetCollection<RecNullableDateTime>()
let date = Nullable()
docs.Insert ({ Id = 1; Date = date }) |> ignore
docs.FindAll()
|> Seq.tryHead
|> function
| None -> fail()
| Some doc ->
match doc.Id, doc.Date with
| 1, date -> pass()
| _ -> fail()
The text was updated successfully, but these errors were encountered:
Hi @Zaid-Ajaj
Nullable DateTime is throwing when trying to read from the database. When inserting the value in the database, the JToken used is StartObject, but when reading it expects DateTime, that throws an exception.
These are the test cases:
The text was updated successfully, but these errors were encountered: