public async Task <ArticlePriceListOutResponse> AddArticlePriceListOutAsync(AddArticlePriceListOutRequest request) { ArticlePriceListOut articlePriceListOut = _articlePriceListOutMapper.Map(request); ArticlePriceListOut result = _articlePriceListOutRespository.Add(articlePriceListOut); int modifiedRecords = await _articlePriceListOutRespository.UnitOfWork.SaveChangesAsync(); _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords); _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id); return(_articlePriceListOutMapper.Map(result)); }
public async Task <RespContainer <ArticlePriceListOutResponse> > Handle(AddArticlePriceListOutCommand request, CancellationToken cancellationToken) { Models.ArticlePriceListOut articlePriceListOut = _articlePriceListOutMapper.Map(request.Data); Models.ArticlePriceListOut result = _articlePriceListOutRespository.Add(articlePriceListOut); int modifiedRecords = await _articlePriceListOutRespository.UnitOfWork.SaveChangesAsync(); _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords); _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id); return(RespContainer.Ok(_articlePriceListOutMapper.Map(result), "ArticlePriceListOut Created")); }