Esempio n. 1
0
        public async Task <ActionResult <BrandApi> > GetById(string id)
        {
            var brand = await _brandManager.GetById(id);

            var brandApi = _mapper.Map <BrandApi>(brand);

            return(Ok(brandApi));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public IActionResult GetById(int id)
        {
            var result = _brandManager.GetById(id);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }