public async Task <IActionResult> Edit(int id, [Bind("GameId,GameDate,Venue,PaidAmount,PaidByMemberId")] Game game)
        {
            if (id != game.GameId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(game);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameExists(game.GameId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }

            ViewData["PaidByMemberId"] = new SelectList(await GamesPaidBySelectItem.GetItems(_context.Members), "Id", "Name", game.PaidByMemberId);
            return(View(game));
        }
        // GET: Games/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var game = await _context.Games.FindAsync(id);

            if (game == null)
            {
                return(NotFound());
            }


            ViewData["PaidByMemberId"] = new SelectList(await GamesPaidBySelectItem.GetItems(_context.Members), "Id", "Name", game.PaidByMemberId);
            return(View(game));
        }