I am trying to delete record from table store but I having problem of recognizing DeleteObject in my code. I have reference
using System.Linq; using System.Data.Entity; using System.Data.Objects; but it still not working. I am using MVC 4 using Visual Studio 2012.
public void Delete() { using (var db = new AppContext()) { var query_D = (from b in db.Stores where b.storeID == 1 select b).First(); db.DeleteObject(query_D); db.SaveChanges(); } } thanks in advance
db.Stores.Removeordb.Stores.Deleteor anything else that is in your context version and same logic ...