public async Task <IActionResult> Edit(int id, [Bind("Id,IdUser,IdNews,Status")] ImportantNews importantNews)
        {
            if (id != importantNews.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(importantNews);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ImportantNewsExists(importantNews.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdNews"] = new SelectList(_context.News, "Id", "Id", importantNews.IdNews);
            ViewData["IdUser"] = new SelectList(_context.User, "Id", "Email", importantNews.IdUser);
            return(View(importantNews));
        }
        public async Task <IActionResult> Create([Bind("IdUser,IdNews")] ImportantNews importantNews)
        {
            if (ModelState.IsValid)
            {
                _context.Add(importantNews);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdNews"] = new SelectList(_context.News, "Id", "Id", importantNews.IdNews);
            //ViewData["IdUser"] = new SelectList(_context.User, "Id", "Email", importantNews.IdUser);
            return(View(importantNews));
        }