public ActionResult Edit([Bind(Include = "Id,Title")] ArticleCategory articleCategory) { if (ModelState.IsValid) { _repo.Update(articleCategory); return(RedirectToAction("Index")); } return(View(articleCategory)); }
public ActionResult Edit(ArticleCategory articleCategory) { if (ModelState.IsValid) { _repo.Update(articleCategory); return(RedirectToAction("Index")); } return(View(articleCategory)); }
public async Task <IActionResult> Update(int id, ArticleCategory model) { model.Id = id; var result = await _repo.Update(model); if (result == null) { return(StatusCode(StatusCodes.Status500InternalServerError, new Response <ArticleCategory>() { Succeeded = false, Message = "ثبت دسته با مشکل مواجه شد لطفا ورودی های خود را چک کرده و مجددا تلاش کنید" })); } return(Ok(new Response <ArticleCategory>(result) { Message = "دسته با موفقیت بروزرسانی شد" })); }