public int Criar(Jogo jogo)
 {
     using(var db = new BancoDeDadosCF())
     {
         db.Entry(jogo).State = System.Data.Entity.EntityState.Added;
         return db.SaveChanges();
     }
 }
 public int Atualizar(Locacao locacao)
 {
     using (var db = new BancoDeDadosCF())
     {
         db.Entry(locacao).State = System.Data.Entity.EntityState.Modified;
         return db.SaveChanges();
     }
 }
 public int Atualizar(Usuario user)
 {
     using (var db = new BancoDeDadosCF())
     {
         db.Entry(user).State = System.Data.Entity.EntityState.Modified;
         return db.SaveChanges();
     }
 }
 public int Excluir(int id)
 {
     using(var db = new BancoDeDadosCF())
     {
         Jogo jogo = db.Jogo.Find(id);
         db.Entry(jogo).State = System.Data.Entity.EntityState.Deleted;
         return db.SaveChanges();
     }
 }
 public int Excluir(int id)
 {
     using (var db = new BancoDeDadosCF())
     {
         Usuario user = db.Usuario.Find(id);
         db.Entry(user).State = System.Data.Entity.EntityState.Deleted;
         return db.SaveChanges();
     }
 }