public async Task Handle(CreateDimensionCommand command) { if (await _dimensionRepository.GetByLeafCategoryId(command.LeafCategoryId) != null) { throw new Exception(); } var dimension = DimensionFactory.CreateDimensionFrom(command); _dimensionRepository.Add(dimension); }