Beispiel #1
0
        public Occasion Update(Occasion alteredEvent)
        {
            var occasion = applicationContext.Occasions.Attach(alteredEvent);

            occasion.State = EntityState.Modified;
            applicationContext.SaveChanges();
            return(alteredEvent);
        }
Beispiel #2
0
        public Occasion Delete(int id)
        {
            Occasion occasion = applicationContext.Occasions.Find(id);

            if (occasion != null)
            {
                applicationContext.Occasions.Remove(occasion);
                applicationContext.SaveChanges();
            }
            return(occasion);
        }
Beispiel #3
0
 public Occasion Add(Occasion Event)
 {
     applicationContext.Add(Event);
     applicationContext.SaveChanges();
     return(Event);
 }