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

            var dimension = DimensionFactory.CreateDimensionFrom(command);

            _dimensionRepository.Add(dimension);
        }
예제 #2
0
 public Dimension Add(Dimension Dimension)
 {
     try
     {
         _DimensionRepository.Add(Dimension);
         return(Dimension);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public bool AddDimensions([FromBody] Dimension[] dimensions)
 {
     try
     {
         foreach (Dimension dim in dimensions)
         {
             _dimRepo.Add(dim);
         }
         _dimRepo.SaveChanges();
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
        public void Create(CreateDimensionDTO dto)
        {
            var dimension = new Dimension(1, dto.Name);

            _repository.Add(dimension);
        }
예제 #5
0
        public void Handle(CreateDimensionCommand command)
        {
            var dimension = new Dimension(command.Name, this._publisher);

            _repository.Add(dimension);
        }