Example #1
0
        public AppUser Update(AppUser updatedUser)
        {
            using (var db = new NesCollectorDBContext())
            {
                var existingUser = GetById(updatedUser.Id);
                db.Entry(existingUser).CurrentValues.SetValues(updatedUser);
                db.SaveChanges();

                return(existingUser);
            }
        }
Example #2
0
        public Game Update(Game updatedGame)
        {
            using (var db = new NesCollectorDBContext())
            {
                var existingGame = GetById(updatedGame.Id);
                db.Entry(existingGame).CurrentValues.SetValues(updatedGame);
                db.SaveChanges();

                return(existingGame);
            }
        }
Example #3
0
        public Wishlist Update(Wishlist updatedWishlist)
        {
            using (var db = new NesCollectorDBContext())
            {
                var existingWishlist = GetById(updatedWishlist.Id);
                db.Entry(existingWishlist).CurrentValues.SetValues(updatedWishlist);
                db.SaveChanges();

                return(existingWishlist);
            }
        }