public async Task Handle(CreateDimensionCommand command) { if (await _dimensionRepository.GetByLeafCategoryId(command.LeafCategoryId) != null) { throw new Exception(); } var dimension = DimensionFactory.CreateDimensionFrom(command); _dimensionRepository.Add(dimension); }
public Dimension Add(Dimension Dimension) { try { _DimensionRepository.Add(Dimension); return(Dimension); } catch (Exception ex) { throw ex; } }
public bool AddDimensions([FromBody] Dimension[] dimensions) { try { foreach (Dimension dim in dimensions) { _dimRepo.Add(dim); } _dimRepo.SaveChanges(); } catch (Exception e) { return(false); } return(true); }
public void Create(CreateDimensionDTO dto) { var dimension = new Dimension(1, dto.Name); _repository.Add(dimension); }
public void Handle(CreateDimensionCommand command) { var dimension = new Dimension(command.Name, this._publisher); _repository.Add(dimension); }