views:

27

answers:

1

Hi,

I am able to add data, but not sure how should I update the data. I am getting AddObject,DeleteObject methods not found any method to update.

Thanks

+2  A: 

You simply grab an (or multiple) object(s), manipulate them and call SaveChanges on the context. Of course, the object has to be attached to the context and tracking must enabled.

var obj = context.table.first(o => o.ID == 1);
obj.Property1 = data;
context.SaveChanges();
Femaref
Thanks for reply I tried this but not working Investor inv = context.Investors.First(i => i.InvestorId == new Guid(investorId)); if (inv != null) { inv.InvestorName = tbInvestorName.Value; context.SaveChanges(); }
BreakHead
Hey Sorry My Mistake it was some diferent error..Thanks its working
BreakHead

related questions