Ejemplo n.º 1
0
 public int Criar(Jogo jogo)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(jogo).State = EntityState.Added;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public int Excluir(int id)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(new Jogo(id)).State = System.Data.Entity.EntityState.Deleted;
         return db.SaveChanges();
     }
 }
 public int Criar(Jogo jogo)
 {
     using(banco = new BancoDeDados())
     {
         banco.Jogo.Add(jogo);
         return banco.SaveChanges();
     }
 }
 public int Excluir(int id)
 {
     using(banco= new BancoDeDados())
     {
         banco.Jogo.Remove(banco.Jogo.Find(id));
         return banco.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 public int Atualizar(Jogo jogo)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(jogo).State = EntityState.Modified;
         return db.SaveChanges();
     }
 }
 public int Atualizar(Jogo jogo)
 {
     using (banco = new BancoDeDados())
     {
         banco.Entry(jogo).State = System.Data.Entity.EntityState.Modified;
         return banco.SaveChanges();
     }
 }
 public int Cadastrar(Usuario entidade)
 {
     using (var dataBase = new BancoDeDados())
     {
         dataBase.Entry(entidade).State = System.Data.Entity.EntityState.Added;
         return dataBase.SaveChanges();
     }
 }
Ejemplo n.º 8
0
 public int Devolucao(Locacao locacao)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(locacao).State = EntityState.Modified;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 9
0
 public int Criar(Jogo entidade)
 {
     using (BancoDeDados db = new BancoDeDados())
     {
         db.Entry(entidade).State = System.Data.Entity.EntityState.Added;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 10
0
 public int Criar(Locacao locacao)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(locacao).State = System.Data.Entity.EntityState.Added;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 11
0
        public int Atualizar(Jogo entidade)
        {
            using(var dataBase = new BancoDeDados())
            {
                dataBase.Entry(entidade).State = System.Data.Entity.EntityState.Modified;

                return dataBase.SaveChanges();
            }
        }
 public int Excluir(int id)
 {
     using (var db = new BancoDeDados())
     {
         var query = db.Jogo.Where(j => j.Id == id).ToList();
         db.Entry(query).State = System.Data.Entity.EntityState.Deleted;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 13
0
 public int Criar(Jogo jogo)
 {
     using (BancoDeDados db = new BancoDeDados())
     {
         db.Entry(jogo).State = System.Data.Entity.EntityState.Added;
         return db.SaveChanges();
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
 public int Atualizar(Jogo jogo)
 {
     using (BancoDeDados db = new BancoDeDados())
     {
         db.Entry(jogo).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
         throw new NotImplementedException();
 }
Ejemplo n.º 15
0
 public int Excluir(int id)
 {
     using (var db = new BancoDeDados())
     {
         Jogo jogo = db.Jogo.Find(id);
         db.Entry(jogo).State = EntityState.Deleted;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 16
0
 public int Atualizar(Locacao locacao)
 {
     using (var db = new BancoDeDados())
     {
         db.Entry(locacao.Jogo).State = System.Data.Entity.EntityState.Modified;
         db.Entry(locacao).State = System.Data.Entity.EntityState.Modified;
         return db.SaveChanges();
     }
 }
Ejemplo n.º 17
0
        public int Excluir(int id)
        {
            Jogo entidade = new Jogo(id);

            using (BancoDeDados db = new BancoDeDados())
            {
                db.Entry(entidade).State = System.Data.Entity.EntityState.Deleted;
                return db.SaveChanges();
            }
        }