public async Task <ActionResult <BrandApi> > Update(UpdateBrandApiRequest request) { var model = _mapper.Map <UpdateBrand>(request); var response = await _brandManager.Update(model); var modelApi = _mapper.Map <BrandApi>(response); return(Ok(modelApi)); }
public IActionResult Update(Brand brand) { var result = _brandManager.Update(brand); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <IActionResult> Update(UpdateBrandViewModel updateBrandViewModel) { if (ModelState.IsValid) { Brand updateBrand = _iMapper.Map <Brand>(updateBrandViewModel); bool isAdd = await _iBrandManager.Update(updateBrand); if (isAdd) { return(RedirectToAction("Index")); } else { ViewBag.ErrorMessage = "Failed to Update Brand"; } } return(View(updateBrandViewModel)); }