Example #1
0
        public brewery Save(brewery brewery)
        {
            if (brewery.breweryID == 0)
            {
                db.breweries.Add(brewery);
            }
            else
            {
                db.Entry(brewery).State = EntityState.Modified;
            }
            db.SaveChanges();

            return(brewery);
        }
Example #2
0
 public void Delete(brewery brewery)
 {
     db.breweries.Remove(brewery);
     db.SaveChanges();
 }