public void inserir(produtos pro) { using (AppBurguerPigEntities db = new AppBurguerPigEntities()) { db.produtos.Add(pro); db.SaveChanges(); } }
public void excluir(produtos pro) { using (AppBurguerPigEntities db = new AppBurguerPigEntities()) { db.Entry(pro).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void alterar(produtos pro) { using (AppBurguerPigEntities db = new AppBurguerPigEntities()) { db.Entry(pro).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }