public void Execute(InsertBrandDto request) { _validator.ValidateAndThrow(request); var brand = _mapper.Map <Brand>(request); _context.Brands.Add(brand); _context.SaveChanges(); }
public void Execute(BrandDto request) { _validator.ValidateAndThrow(request); var brand = new Brand { Name = request.Name }; _context.Brands.Add(brand); _context.SaveChanges(); }