Beispiel #1
0
        public async Task <ArticleGroupResponse> AddArticleGroupAsync(AddArticleGroupRequest request)
        {
            ArticleGroup articleGroup = _articleGroupMapper.Map(request);
            ArticleGroup result       = _articleGroupRespository.Add(articleGroup);

            int modifiedRecords = await _articleGroupRespository.UnitOfWork.SaveChangesAsync();

            _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords);
            _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id);

            return(_articleGroupMapper.Map(result));
        }
Beispiel #2
0
        public ArticleGroup Map(AddArticleGroupRequest request)
        {
            if (request == null)
            {
                return(null);
            }

            ArticleGroup articleGroup = new ArticleGroup
            {
                Name = request.Name,
            };

            return(articleGroup);
        }