public async Task <IActionResult> Edit(int id, [Bind("Id,Title,CreationDate,DisableDate,RemoveDate,PictureAddress")] Category category, IFormFile file) { if (id != category.Id) { return(NotFound()); } if (ModelState.IsValid) { try { await adminServices.EditCategory(category, file); } catch (DbUpdateConcurrencyException) { if (!adminServices.CategoryExists(category.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(category)); }