public brewery Save(brewery brewery) { if (brewery.breweryID == 0) { db.breweries.Add(brewery); } else { db.Entry(brewery).State = EntityState.Modified; } db.SaveChanges(); return(brewery); }
public void Delete(brewery brewery) { db.breweries.Remove(brewery); db.SaveChanges(); }