SubSonic equivalent SQL update

I am wondering if the following SQL update query is possible using equivalent SubSonic commands:

UPDATE MYTABLE SET MYFIELD = MYFIELD + 3 WHERE ANOTHERFIELD = ANOTHERVALUE

I could not find a suitable way to link to the same field with the Setting object.

Any help on this would be greatly appreciated.

Hello,

Fernando

+3
source share
3 answers

You can execute this query using the QueryCommand subsonic object.

Here you can find similar samples link and link

+2
source

- "UpdateExpression" - , "" . - "SetExpression", , , .

+1

, , SetExpression(), - , ... , ( ) - , ?

int count = new Update(MyTable.Schema).SetExpression("MyField").EqualTo("MyField + 20")
.Where(....)

, , , , ( ), , .

+1

Source: https://habr.com/ru/post/1727728/


All Articles