Esempio n. 1
0
        public void Update(Gym changedGym)
        {
            var gym = context.Gyms.Attach(changedGym);

            gym.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
        }
Esempio n. 2
0
        public void Delete(int id)
        {
            Gym gym = context.Gyms.Find(id);

            if (gym != null)
            {
                context.Gyms.Remove(gym);
                context.SaveChanges();
            }
        }
Esempio n. 3
0
 public void Add(Gym gym)
 {
     context.Gyms.Add(gym);
     context.SaveChanges();
 }