public async Task <ActionResult <BrandApi> > GetById(string id) { var brand = await _brandManager.GetById(id); var brandApi = _mapper.Map <BrandApi>(brand); return(Ok(brandApi)); }
public async Task <ActionResult <UpdateBrandViewModel> > Update(int?id) { if (id == null) { return(NotFound()); } UpdateBrandViewModel existBrand = _iMapper.Map <UpdateBrandViewModel> (await _iBrandManager.GetById(id)); if (existBrand == null) { return(NotFound()); } return(View(existBrand)); }
public IActionResult GetById(int id) { var result = _brandManager.GetById(id); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }