public void Execute(InsertBrandDto request)
        {
            _validator.ValidateAndThrow(request);
            var brand = _mapper.Map <Brand>(request);

            _context.Brands.Add(brand);
            _context.SaveChanges();
        }
예제 #2
0
        public void Execute(BrandDto request)
        {
            _validator.ValidateAndThrow(request);

            var brand = new Brand
            {
                Name = request.Name
            };

            _context.Brands.Add(brand);

            _context.SaveChanges();
        }