public IActionResult Edit(int id) { MainCategoryEditInputModel mainCategoryEditInputModel = this.mainCategoryService .GetMainCategoryById(id) .To <MainCategoryEditInputModel>(); return(this.View(mainCategoryEditInputModel)); }
public async Task <IActionResult> Edit(MainCategoryEditInputModel mainCategoryEditInputModel) { if (!this.ModelState.IsValid) { return(this.View(mainCategoryEditInputModel)); } await this.mainCategoryService.EditAsync(mainCategoryEditInputModel.To <MainCategoryServiceModel>()); return(this.RedirectToAction("All", "MainCategories")); }