我每次看到示例顯示瞭如何做一個更新查詢在LINQ通過執行此SQL語句。如何將Linq更新爲SqL?
// grab entity you want to update
entity.UserId = "123"; // update the fields you want to update.
entity.Name = "bob";
Dbcontext.SubmitChanges();
我想知道你能JUSE傳遞一個新的對象,並將它弄明白?
就像我能做到這一點?
Enity myEntity = new Entity();
myEntity.UserId = "123";
myEntity.Name = bob:
// grab entity record
// shove record ito the found record
// it figured out what to update and what no to update
我不太瞭解linq到sql或這個附加方法。我所知道的是我向你展示的內容,你抓取記錄的位置,然後對其進行更改並提交。 – chobo2 2009-08-28 02:34:22