Ejemplo n.º 1
0
        public async Task <Usuario> Alterar(Usuario usuario)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Entry(usuario).State = EntityState.Modified;
                await _contexto.SaveChangesAsync();

                return(usuario);
            }
        }
Ejemplo n.º 2
0
        public async Task <Localizacao> Alterar(Localizacao localizacao)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Entry(localizacao).State = EntityState.Modified;
                await _contexto.SaveChangesAsync();

                return(localizacao);
            }
        }
Ejemplo n.º 3
0
        public async Task <Localizacao> Excluir(Localizacao localizacao)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Localizacao.Remove(localizacao);
                await _contexto.SaveChangesAsync();

                return(localizacao);
            }
        }
Ejemplo n.º 4
0
        public async Task <Usuario> Excluir(Usuario usuario)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Usuario.Remove(usuario);
                await _contexto.SaveChangesAsync();

                return(usuario);
            }
        }
Ejemplo n.º 5
0
        public async Task <Presenca> Alterar(Presenca presenca)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Entry(presenca).State = EntityState.Modified;
                await _contexto.SaveChangesAsync();

                return(presenca);
            }
        }
Ejemplo n.º 6
0
        public async Task <Evento> Alterar(Evento evento)
        {
            using (BDGUFOSContext _context = new BDGUFOSContext()) {
                _context.Entry(evento).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(evento);
            }
        }
Ejemplo n.º 7
0
        public async Task <Evento> Excluir(Evento evento)
        {
            using (BDGUFOSContext _context = new BDGUFOSContext()) {
                _context.Evento.Remove(evento);
                await _context.SaveChangesAsync();

                return(evento);
            }
        }
Ejemplo n.º 8
0
        public async Task <Presenca> Excluir(Presenca presenca)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Presenca.Remove(presenca);
                await _contexto.SaveChangesAsync();

                return(presenca);
            }
        }
Ejemplo n.º 9
0
        public async Task <Localizacao> Salvar(Localizacao localizacao)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                await _contexto.AddAsync(localizacao);

                await _contexto.SaveChangesAsync();

                return(localizacao);
            }
        }
Ejemplo n.º 10
0
        public async Task <Usuario> Salvar(Usuario usuario)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                await _contexto.AddAsync(usuario);

                await _contexto.SaveChangesAsync();

                return(usuario);
            }
        }
Ejemplo n.º 11
0
        public async Task <Evento> Salvar(Evento evento)
        {
            using (BDGUFOSContext _context = new BDGUFOSContext()) {
                await _context.AddAsync(evento);

                await _context.SaveChangesAsync();

                return(evento);
            }
        }
Ejemplo n.º 12
0
        public async Task <Presenca> Salvar(Presenca presenca)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                await _contexto.AddAsync(presenca);

                await _contexto.SaveChangesAsync();

                return(presenca);
            }
        }
Ejemplo n.º 13
0
        public async Task <Categoria> Alterar(Categoria categoria)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                _contexto.Entry(categoria).State = EntityState.Modified;

                await _contexto.SaveChangesAsync();

                return(categoria);
            }
        }
Ejemplo n.º 14
0
        public async Task <Categoria> Excluir(Categoria categoria)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                //Removendo objeto e salva as mudanças
                _contexto.Categoria.Remove(categoria);
                await _contexto.SaveChangesAsync();

                return(categoria);
            }
        }
Ejemplo n.º 15
0
        public async Task <Categoria> Salvar(Categoria categoria)
        {
            using (BDGUFOSContext _contexto = new BDGUFOSContext()) {
                //Tratamos contra ataques de SQL INJECTION
                await _contexto.AddAsync(categoria);

                //Salvando objeto no banco de dados
                await _contexto.SaveChangesAsync();

                return(categoria);
            }
        }