public void Update(Project4 item) { using (masterContext db = new masterContext()) { db.Project4.Update(item); db.SaveChanges(); } }
public void Delete(int pid) { using (masterContext db = new masterContext()) { Project4 p = db.Project4.Find(pid); db.Project4.Remove(p); db.SaveChanges(); } }
static void Main(string[] args) { using (MyContext db = new MyContext()) { Project4 p = new Project4() { ProjectName = "BFS" }; db.Add(p); db.SaveChanges(); } }