System.InvalidOperationException: The LINQ expression 'DbSet<WorkingTask>() .Where(w => new Work
I have following code:
I don't know why but I always get error after
.Sort(context).ToList();
. how to fix this?3 Replies
full error:
but I already use ToList
i use HotChocolate
SQL doesn't know how to create C# objects
so
new WorkingTask{ Identity = w.Identity }
is not something that can be translated into a query
it would be fine if you were projecting into it because that's on the C# side after the query runs
but you're trying to use that object in a WHEREthis method used by graphql, let's some examples
and if the first one doesn't work at all, the second one works
so sometimes it can be translated
:OhNo:
and I get error after
.Filter(context).ToList()
, .Project(context).ToList()
works good