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
I discovered LINQ Where() doesn't correctly parse enums having the [StoreAsText] attributes. For example, let's say we have tables created from the following object:
Fetching all income transactions using LINQ should look like this:
// Isolating the query so it can be inspected.varquery=database.Table<Transaction>().Where(t =>t.Type==TransactionTypes.Income);List<Transaction>transaction=awaitquery.ToListAsync()
But this will return no item.
Inspecting query in the debug view as an Expression shows that it interprets the given predicate supposing that Transaction.Type would be stored as an integer, ignoring the StoreAsText attribute.
The text was updated successfully, but these errors were encountered:
Hi. Well done for the good work done here.
I discovered LINQ
Where()
doesn't correctly parse enums having the[StoreAsText]
attributes. For example, let's say we have tables created from the following object:Fetching all income transactions using LINQ should look like this:
But this will return no item.
Inspecting
query
in the debug view as anExpression
shows that it interprets the given predicate supposing thatTransaction.Type
would be stored as an integer, ignoring theStoreAsText
attribute.The text was updated successfully, but these errors were encountered: