Ejemplo n.º 1
0
 private static void Recuperar()
 {
     using (var repo = new SistemaEstacionamentosContext())
     {
         IList <Estacionamento> estacionamentos = repo.Estacionamentos.ToList();
     }
 }
Ejemplo n.º 2
0
        private static void Gravar()
        {
            Estacionamento e = new Estacionamento();

            using (var repo = new SistemaEstacionamentosContext())
            {
                repo.Estacionamentos.Add(e);
                repo.SaveChanges();
            }
        }
        private static void Gravar()
        {
            Tickets t = new Tickets();

            using (var repo = new SistemaEstacionamentosContext())
            {
                repo.Tickets.Add(t);
                repo.SaveChanges();
            }
        }
Ejemplo n.º 4
0
        private static void Editar(int Handler)
        {
            using (var repo = new SistemaEstacionamentosContext())
            {
                var EstacionamentoParaAtualizar = repo.Estacionamentos.Find(Handler);
                //Definir campo a ser atualizado
                repo.Estacionamentos.Update(EstacionamentoParaAtualizar);

                repo.SaveChanges();
            }
        }
Ejemplo n.º 5
0
 private static void Excluir()
 {
     using (var repo = new SistemaEstacionamentosContext())
     {
         IList <Estacionamento> estacionamentos = repo.Estacionamentos.ToList();
         foreach (var estacionamento in estacionamentos)
         {
             repo.Estacionamentos.Remove(estacionamento);
         }
         repo.SaveChanges();
     }
 }