public IActionResult Edit(int id, [Bind("ArticleId,Title,Abstract,Contents,CreatedDate,AuthorId,Url,MainImagePath,InActive, AuthorName")] Article article) { if (ModelState.IsValid) { try { _repo.Update(article); } catch (DbUpdateConcurrencyException) { if (!_repo.ArticleExists(article.ArticleId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } //ViewData["AuthorId"] = new SelectList(_context.Users, "Id", "Id", article.AuthorId); return(View(article)); }