1

I have the following code using SubSonic 2.1/2.2

SubSonic.Update(<some table>)
.Set(<column A>)
.EqualTo(<column B>).
Where(condition...).Execute()

I would like to change it to update "column A" with the value of "column B" + 1. How can I do it with this syntax.

Is there a better SubSonic syntax to achieve the same thing:

ColumnA = ColumnB + 1

Or even

ColumnA = ColumnA + a

Ron Harlev
  • 16,227
  • 24
  • 89
  • 132

1 Answers1

4

Using SetExpression instead of Set will solve the problem

SubSonic.Update(<some table>)
.SetExpression("columnA")
.EqualTo("columnB + 1").
Where(condition...).Execute()
Ron Harlev
  • 16,227
  • 24
  • 89
  • 132