开发者

Subsonic 3.0 UPDATE, multiple conditions

开发者 https://www.devze.com 2022-12-26 06:52 出处:网络
db.Update<Luna.Record.TB_ITEM>().Set( x => x.ITEM_DURABILITY == Convert.ToInt32(quantity)) .Where(x => x.ITEM_POSITION == Convert.ToInt32(position))
      db.Update<Luna.Record.TB_ITEM>().Set(
                x => x.ITEM_DURABILITY == Convert.ToInt32(quantity))
                .Where(x => x.ITEM_POSITION == Convert.ToInt32(position))
                .Execute();

How will I add an AND clause this is how it looks like in plain SQL:

UPDATE TB_ITEM
SET ITEM_DURABITLITY=@quantity
WHERE ITEM_POSITION=@p开发者_StackOverflow社区osition AND CHARACTER_IDX=@charidx


.Where(x => x.ITEM_POSITION == Convert.ToInt32(position)
            && x.CHARACTER_IDX == Convert.ToInt32(charidx)) 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号