views:

60

answers:

0

I tried 3 variants but doesn't seem to update (I am using Linq Templates and MSSQL)

    Luna.Data.GameDBDB db = new Luna.Data.GameDBDB(); 
    db.Update<Luna.Record.TB_ITEM>()
        .Set(x => x.ITEM_DURABILITY == Convert.ToInt32(quantity))
        .Where(x => x.ITEM_DBIDX == Convert.ToInt32(dbdidx))
        .Execute();

Here is the other one

var db = new Luna.Data.GameDBDB();
var query = (from p in db.TB_ITEMS where p.ITEM_DBIDX == Convert.ToInt32(dbidx) select p).Single();
query.ITEM_DURABILITY = Convert.ToInt32(quantity);
db.tp TP_ITEM_UPDATE();

and the other one

var db = new Luna.Data.GameDBDB();
var query = (from p in db.TB_ITEMS where p.ITEM_DBIDX == Convert.ToInt32(dbidx) select p).Single();
query.ITEM_DURABILITY = Convert.ToInt32(quantity);
db.Update<Luna.Data.TB_ITEM>();

However it worked using LINQ-to-SQL

            LunaDataContext db = new LunaDataContext();
            var query = (from p in db.TB_ITEMs
                         where p.ITEM_DBIDX == Convert.ToInt32(dbidx)
                         select p).Single();
            query.ITEM_DURABILITY = Convert.ToInt32(quantity);
            db.SubmitChanges();

Is this a bug in 3.0.0.4, the database record couldn't be updated using Linq Templates and ActiveRecord.