public async Task <IActionResult> Edit(int id, KaraokeEvent karaokeEvent)
        {
            if (id != karaokeEvent.Id)
            {
                return(NotFound());
            }

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

            ViewData["AddressId"] = new SelectList(_context.Set <Address>(), "Id", "Id", karaokeEvent.AddressId);
            ViewData["AppUserId"] = new SelectList(_context.Users, "Id", "Id", karaokeEvent.AppUserId);
            return(View(karaokeEvent));
        }
        public async Task <IActionResult> Create(KaraokeEvent karaokeEvent)
        {
            if (ModelState.IsValid)
            {
                var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
                karaokeEvent.AppUserId = userId;



                _context.Add(karaokeEvent);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            //ViewData["AddressId"] = new SelectList(_context.Set<Address>(), "Id", "Id", karaokeEvent.AddressId);
            //ViewData["AppUserId"] = new SelectList(_context.Users, "Id", "Id", karaokeEvent.AppUserId);
            return(View(karaokeEvent));
        }