예제 #1
0
 public List <Bier> FindAll()
 {
     using (var db = new MVCBierenEntities())
     {
         return(db.Bieren.ToList());
     }
 }
예제 #2
0
 public Bier Read(int id)
 {
     using (var db = new MVCBierenEntities())
     {
         return(db.Bieren.Find(id));
     }
 }
예제 #3
0
 public void Add(Bier bier)
 {
     using (var db = new MVCBierenEntities())
     {
         db.Bieren.Add(bier);
         db.SaveChanges();
     }
 }
예제 #4
0
 internal void Add(Bier b)
 {
     using (var db = new MVCBierenEntities())
     {
         db.Bieren.Add(b);
         db.SaveChanges();
     }
 }
예제 #5
0
 public void Delete(int id)
 {
     using (var db = new MVCBierenEntities())
     {
         var bier = db.Bieren.Find(id);
         db.Bieren.Remove(bier);
         db.SaveChanges();
     }
 }