Example #1
0
        public async Task <ArticlePriceListOutResponse> DeleteArticlePriceListOutAsync(DeleteArticlePriceListOutRequest request)
        {
            if (request?.Id == null)
            {
                throw new ArgumentNullException();
            }

            ArticlePriceListOut result = await _articlePriceListOutRespository.GetAsync(request.Id);

            if (result == null)
            {
                throw new ArgumentException($"Entity with {request.Id} is not present");
            }

            result.IsInactive = true;

            _articlePriceListOutRespository.Update(result);
            int modifiedRecords = await _articlePriceListOutRespository.UnitOfWork.SaveChangesAsync();

            _logger.LogInformation(Logging.Events.Delete, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords);

            return(_articlePriceListOutMapper.Map(result));
        }