views:

73

answers:

1
      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=@position AND CHARACTER_IDX=@charidx
A: 
.Where(x => x.ITEM_POSITION == Convert.ToInt32(position)
            && x.CHARACTER_IDX == Convert.ToInt32(charidx)) 
Anthony Faull
That was fast, Thank you
geocine
Luna.Record.GameDBDB db = new Luna.Record.GameDBDB(); db.Update<Luna.Record.TB_ITEM>().Set(x => x.ITEM_DURABILITY == Convert.ToInt32(quantity)) .Where(x => x.CHARACTER_IDX == Convert.ToInt32(Session["CharIndex"].ToString()) Hi I have these now, But it doesn't seem to update the database.
geocine