public Occasion Update(Occasion alteredEvent) { var occasion = applicationContext.Occasions.Attach(alteredEvent); occasion.State = EntityState.Modified; applicationContext.SaveChanges(); return(alteredEvent); }
public Occasion Delete(int id) { Occasion occasion = applicationContext.Occasions.Find(id); if (occasion != null) { applicationContext.Occasions.Remove(occasion); applicationContext.SaveChanges(); } return(occasion); }
public Occasion Add(Occasion Event) { applicationContext.Add(Event); applicationContext.SaveChanges(); return(Event); }