Esempio n. 1
0
        public IActionResult UpdateBrand(int id, [FromBody] BrandAggregate brandDto)
        {
            var brand = new Brand(brandDto.Name, brandDto.CountryCode);

            _brandRepository.Update(id, brand);

            return(Ok($"Brand with ID: {brand.Id} successfully updated"));
        }
Esempio n. 2
0
        public IActionResult CreateBrand([FromBody] BrandAggregate brandDto)
        {
            var brand = new Brand(brandDto.Name, brandDto.CountryCode);

            _brandRepository.Create(brand);

            return(Ok($"Brand {brand.Name} has ID: {brand.Id}"));
        }