Exemple #1
0
 public void AddComment(CommentInfo commentInfo)
 {
     using (var unitOfWork = unitOfWorkFactory.Create())
     {
         unitOfWork.GetRepository <ICommentRepository>()
         .Add(ArticleMapper.Convert(commentInfo));
         unitOfWork.Commit();
     }
 }
Exemple #2
0
 public void AddArticle(ArticleInfo articleInfo)
 {
     using (var unitOfWork = unitOfWorkFactory.Create())
     {
         unitOfWork.GetRepository <IArticleRepository>()
         .Add(ArticleMapper.Convert(articleInfo));
         unitOfWork.Commit();
     }
 }
Exemple #3
0
 public ArticleInfo GetArticleInfo(Guid id)
 {
     using (var unitOfWork = unitOfWorkFactory.Create())
     {
         return(unitOfWork.GetRepository <IArticleRepository>().Get(id)
                .Map(x => ArticleMapper
                     .Convert(x,
                              unitOfWork
                              .GetRepository <ICommentRepository>().GetForArticle(id))).Value);
     }
 }
Exemple #4
0
 public ArticleInfo GetArticleInfo(Guid id)
 {
     return(articleRepository.Get(id)
            .Map(x => ArticleMapper.Convert(x, commentRepository.GetForArticle(id))).Value);
 }
Exemple #5
0
 public void AddComment(CommentInfo commentInfo)
 {
     commentRepository.Add(ArticleMapper.Convert(commentInfo));
 }
Exemple #6
0
 /// <summary>
 /// Adds the article.
 /// </summary>
 /// <param name="articleInfo">The article information.</param>
 /// <returns>
 /// Added article.
 /// </returns>
 public void AddArticle(ArticleInfo articleInfo)
 {
     articleRepository.Add(ArticleMapper.Convert(articleInfo));
 }