Exemplo n.º 1
0
        public async Task CreatePromotionAsync(promotionModels obj)
        {
            var promotion = _mapper.Map <promotionModels, Promotion>(obj);
            await _unitOfWork.Promotion.AddAsync(promotion);

            await _unitOfWork.CompleteAsync();
        }
Exemplo n.º 2
0
        public async Task UpdatePromotionAsync(promotionModels obj)
        {
            var promotion = await _unitOfWork.Promotion.GetByAsync(obj.Idpromotion);

            if (promotion == null)
            {
                return;
            }

            _mapper.Map <promotionModels, Promotion>(obj, promotion);

            await _unitOfWork.CompleteAsync();
        }