public async Task <IActionResult> Edit(int id, ArticleDetailsServiceModel articleModel) { if (!ModelState.IsValid) { return(View(articleModel)); } var userId = this.userManager.GetUserId(User); var update = await this.publications.EditAsync( id, articleModel.Title, articleModel.Content, articleModel.PicUrl, userId); if (!update == null) { return(NotFound()); } this.TempData.AddWarningMessage(string.Format(SuccessfullEdit, articleModel.Title)); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Details(int id) { ArticleDetailsServiceModel model = await this.articleService.GetDetailsByIdAsync(id); return(this.ViewOrNotFound(model)); }