Beispiel #1
0
 public void Add(User newItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         db.Users.Add(newItem);
         db.SaveChanges();
     }
 }
Beispiel #2
0
 public void Add(Location newItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         db.Locations.Add(newItem);
         db.SaveChanges();
     }
 }
 public void Add(Data.Entities.Conference newItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         db.Conferences.Add(newItem);
         db.SaveChanges();
     }
 }
Beispiel #4
0
 public void Delete(User deleteItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         User user = db.Users
                     .Where(u => u.Email == deleteItem.Email)
                     .FirstOrDefault();
         db.Users.Remove(user);
         db.SaveChanges();
     }
 }
Beispiel #5
0
 public void Delete(Location deleteItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         Location location = db.Locations
                             .Where(l => l.LocationId == deleteItem.LocationId)
                             .FirstOrDefault();
         db.Locations.Remove(location);
         db.SaveChanges();
     }
 }
 public void Delete(Data.Entities.Conference deleteItem)
 {
     using (IConferenceDbContext db = factory.Create())
     {
         Data.Entities.Conference conference = db.Conferences
                                               .Where(c => c.ConferenceId == deleteItem.ConferenceId)
                                               .FirstOrDefault();
         db.Conferences.Remove(conference);
         db.SaveChanges();
     }
 }
        public void Update(Data.Entities.Conference changedItem)
        {
            using (IConferenceDbContext db = factory.Create())
            {
                Data.Entities.Conference conference = db.Conferences.Where(l => l.ConferenceId == changedItem.ConferenceId)
                                                      .FirstOrDefault();

                conference.Abstract            = changedItem.Abstract;
                conference.AmountOfLastingDays = changedItem.AmountOfLastingDays;
                conference.Location            = changedItem.Location;
                conference.StartsAt            = changedItem.StartsAt;
                conference.Title = changedItem.Title;

                db.SaveChanges();
            }
        }