Example #1
0
 private async Task <List <UserGame> > GetWishlistGames(User user)
 {
     return(await _context.Entry(user)
            .Collection(u => u.UserGames)
            .Query()
            .Where(ug => ug.IsWish == true)
            .Include(ug => ug.GameRelease)
            .ThenInclude(release => release.Game)
            .Include(ug => ug.GameRelease)
            .ThenInclude(release => release.Platform)
            .ToListAsync());
 }
Example #2
0
        public async Task <IActionResult> PutUser(long id, User user)
        {
            if (id != user.PeopleId)
            {
                return(BadRequest());
            }

            _context.Entry(user).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }