Is it possible to increment an integer in an Update query using Simple.Data?
My database is SQL Server, but I know Simple.Data is designed to be database agnostic so perhaps this query is not available in other providers.
The SQl query I am trying to generate would look like this:
UPDATE MyTable SET MyInt = MyInt + 1 WHERE Id = 123
var result = db.MyTable.Find(db.MyTable.Id == 123);
db.MyTable.UpdateById(Id: result.Id, MyInt: result.MyInt );
You can do this:
db.MyTable.UpdateById(Id: 123, MyInt: db.MyTable.MyInt + 1);
Works on SQL Server, should work in all the SQL-based providers.