Exemple #1
0
 public BL BuscaPorId(int id)
 {
     using (var context = new ListagemContext())
     {
         return(context.Bls.Where(p => p.Id == id).FirstOrDefault());
     }
 }
Exemple #2
0
 public Container BuscaPorId(int id)
 {
     using (var context = new ListagemContext())
     {
         return(context.Containeres.Include("BL").Where(p => p.Id == id).FirstOrDefault());
     }
 }
Exemple #3
0
 public IList <Container> Lista()
 {
     using (var context = new ListagemContext())
     {
         return(context.Containeres.Include("BL").ToList());
     }
 }
Exemple #4
0
 public IList <BL> Lista()
 {
     using (var context = new ListagemContext())
     {
         return(context.Bls.ToList());
     }
 }
Exemple #5
0
 public void Atualiza(BL Bl)
 {
     using (var context = new ListagemContext())
     {
         context.Entry(Bl).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Exemple #6
0
 public void Adiciona(BL Bl)
 {
     using (var context = new ListagemContext())
     {
         context.Bls.Add(Bl);
         context.SaveChanges();
     }
 }
Exemple #7
0
 public void Adiciona(Container container)
 {
     using (var context = new ListagemContext())
     {
         context.Containeres.Add(container);
         context.SaveChanges();
     }
 }
Exemple #8
0
 public void Exclui(int id)
 {
     using (var context = new ListagemContext())
     {
         BL blDeletado = context.Bls.Where(p => p.Id == id).FirstOrDefault();
         context.Bls.Remove(blDeletado);
         context.SaveChanges();
     }
 }
Exemple #9
0
 public IList <BL> Lista()
 {
     using (var context = new ListagemContext())
     {
         List <BL> blList = new List <BL>();
         blList = context.Bls.ToList();
         return(blList);
     }
 }
Exemple #10
0
 public void Exclui(int id)
 {
     using (var context = new ListagemContext())
     {
         Container container = context.Containeres.Include("BL").Where(p => p.Id == id).FirstOrDefault();
         context.Containeres.Remove(container);
         context.SaveChanges();
     }
 }