public async Task <IActionResult> Edit(int id) { BrandServiceModel brandServiceModel = await this.brandService.GetBrandByIdAsync(id); BrandEditInputModel brandEditInputModel = brandServiceModel.To <BrandEditInputModel>(); return(this.View(brandEditInputModel)); }
public async Task <IActionResult> Edit(BrandEditInputModel brandEditInputModel) { if (!this.ModelState.IsValid) { return(this.View(brandEditInputModel)); } await this.brandService.EditAsync(brandEditInputModel.To <BrandServiceModel>()); return(this.RedirectToAction("All", "Brands")); }