This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I want to use UnitOfWork.Update to update some entities, but I don't know how to write the set clauses. The only overload of UnitOfWork.Update has two parameters, the Query part is working just great, however I'd like to increment a value using something like this:
I think right now this is not possible, since you can only specify an object or dictionary with the values that need to be set, not an expression, at least I haven't seen any examples of this type of query. Jaap |
|
|
You wont be able to do this with UnitOfWork.Update - if you need to specify calculations you will need to either do this on an entity by entity basis (e.g. load in the entities and just increment MyField and then persist) or use a SQL escape hatch like a stored proc to perform the update.
|
|