Пример #1
0
        public GameAppUser RemoveFromShelf(GameAppUser gameAppUser)
        {
            var dbEntry = _applicationDBContext.GameAppUser.FirstOrDefault
                              (gu => gu.GameId == gameAppUser.GameId && gu.UserId == gameAppUser.UserId);

            if (dbEntry != null)
            {
                _applicationDBContext.GameAppUser.Remove(dbEntry);

                _applicationDBContext.SaveChanges();
            }

            return(dbEntry);
        }
Пример #2
0
        public void AddToShelf(GameAppUser gameAppUser)
        {
            _applicationDBContext.GameAppUser.Add(gameAppUser);

            _applicationDBContext.SaveChanges();
        }