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)); }
public ArticleGroup Map(AddArticleGroupRequest request) { if (request == null) { return(null); } ArticleGroup articleGroup = new ArticleGroup { Name = request.Name, }; return(articleGroup); }