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

            var dimension = DimensionFactory.CreateDimensionFrom(command);

            _dimensionRepository.Add(dimension);
        }
Ejemplo n.º 2
0
 public Dimension Add(Dimension Dimension)
 {
     try
     {
         _DimensionRepository.Add(Dimension);
         return(Dimension);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
        public void Create(CreateDimensionDTO dto)
        {
            var dimension = new Dimension(1, dto.Name);

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

            _repository.Add(dimension);
        }