Linq Where JsonSerialization not working
Hey, is there a way to get the following running:
I am getting the error an expression tree cannot contain a call or invocation that uses optional arguments
3 Replies
What does your table entity look like?
which part of that can take optional arguments? the json .Deserialize?
in any case you just need to explicitly put in the default arguments
oh -- or
dbSet.Set()
maybe
the inability to handle optional arguments is just a failing of expression trees, nothing database relatedThe database can't do JSON deserialization, so of course this won't work.
Either
a) use a database that supports JSONB
b) do the filtering on the client
c) save this one particular value in its own column
a) would be preferable, then c)
b) is a last resort