Пример #1
0
 public IList <Pedido> Lista()
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Pedido.ToList());
     }
 }
Пример #2
0
 public IList <Filtro> Lista()
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Filtro.ToList());
     }
 }
Пример #3
0
 public IList <Cliente> Lista()
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Cliente.ToList());
     }
 }
Пример #4
0
 public IList <Loja> Lista()
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Loja.ToList());
     }
 }
Пример #5
0
 public void Atualiza(Pedido Pedido)
 {
     using (var contexto = new LoginContext())
     {
         contexto.Entry(Pedido).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
Пример #6
0
 public void Adiciona(Pedido c)
 {
     using (var context = new LoginContext())
     {
         c.Id = 0;
         context.Pedido.Add(c);
         context.SaveChanges();
     }
 }
Пример #7
0
 public Filtro BuscaPorNome(string nome)
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Filtro
                .Where(p => p.Animal == nome)
                .FirstOrDefault());
     }
 }
Пример #8
0
 public void Atualiza(Loja Loja)
 {
     using (var contexto = new LoginContext())
     {
         Loja.Id = 0;
         contexto.Entry(Loja).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
Пример #9
0
 public Produto BuscaPorId(int id)
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Produto
                .Where(p => p.Id == id)
                .FirstOrDefault());
     }
 }
Пример #10
0
 public Produto BuscaPorNome(string nome)
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.Produto
                .Where(p => p.Nome == nome)
                .FirstOrDefault());
     }
 }
Пример #11
0
 public void Adiciona(Cliente c)
 {
     using (var context = new LoginContext())
     {
         c.Id = 0;
         context.Cliente.Add(c);
         context.SaveChanges();
     }
 }
Пример #12
0
 public void Adiciona(Loja c)
 {
     using (var context = new LoginContext())
     {
         c.Id = 0;
         context.Loja.Add(c);
         context.SaveChanges();
     }
 }
Пример #13
0
 public ItemPedido BuscaPorNome(int id)
 {
     using (var contexto = new LoginContext())
     {
         return(contexto.ItemPedido
                .Where(p => p.Id == id)
                .FirstOrDefault());
     }
 }