如何使用servicestack.ormlite进行增加更新

时间:2015-05-04 03:15:04

标签: .net ormlite-servicestack

ServiceStack.Ormlite中是否有任何方式可以执行以下更新: update tableName set field = field + 1 where ....

1 个答案:

答案 0 :(得分:0)

你可以通过UpdateFmt这样的函数来实现......

db.UpdateFmt<Poco>(set: "IntValue = IntValue + 1", where: "Id = {0}".Fmt(1));