public int Criar(Jogo jogo) { using (var db = new CodeFirst()) { db.Entry(jogo).State = System.Data.Entity.EntityState.Added; return db.SaveChanges(); } }
public int Excluir(int id) { using (var db = new CodeFirst()) { Jogo jogo=BuscarPorId(id); db.Entry(jogo).State = System.Data.Entity.EntityState.Deleted; return db.SaveChanges(); } }