I have a lambda expression:
(x) => x.Visits++
At runtime, I want to translate this into the string:
"set Visits = Visits + 1"
or, potentially, if the underlying data store is different (like MongoDB)
{$inc: {Visits : 1}}
I think the way to do this is to use expression trees, but when I assign the lambda expression to an expression tree, I get "An expression tree may not contain an assignment operator".
Is there any way to accomplish this short of writing a full up linq implementation that supports Update?