public List <Bier> FindAll() { using (var db = new MVCBierenEntities()) { return(db.Bieren.ToList()); } }
public Bier Read(int id) { using (var db = new MVCBierenEntities()) { return(db.Bieren.Find(id)); } }
public void Add(Bier bier) { using (var db = new MVCBierenEntities()) { db.Bieren.Add(bier); db.SaveChanges(); } }
internal void Add(Bier b) { using (var db = new MVCBierenEntities()) { db.Bieren.Add(b); db.SaveChanges(); } }
public void Delete(int id) { using (var db = new MVCBierenEntities()) { var bier = db.Bieren.Find(id); db.Bieren.Remove(bier); db.SaveChanges(); } }