コード例 #1
0
 public void DeleteComment(Comment comment)
 {
     using (ISession session = OpenSession())
     {
         session.Delete(comment);
         session.Flush();
     }
 }
コード例 #2
0
        public void AddComment(Comment comment)
        {
            using (ISession session = OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.SaveOrUpdate(comment);

                    transaction.Commit();
                }
            }
        }
コード例 #3
0
ファイル: BlogService.svc.cs プロジェクト: drypa/BlogSample
 public void DeleteComment(Comment comment)
 {
     writeBlogRepository.DeleteComment(comment);
 }
コード例 #4
0
ファイル: BlogService.svc.cs プロジェクト: drypa/BlogSample
 public void AddComment(Comment comment)
 {
     writeBlogRepository.AddComment(comment);
 }
コード例 #5
0
 public void DeleteComment(Comment comment)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: drypa/BlogSample_v2
 private static void OnAction(DeleteCommentRequest request)
 {
     var comment = new Comment { Id = request.CommentId };
     repository.DeleteComment(comment);
     Console.WriteLine("Удалён коментарий: '{0}'", comment.Id);
 }
コード例 #7
0
ファイル: Program.cs プロジェクト: drypa/BlogSample_v2
 private static void OnAction(AddCommentRequest request)
 {
     var comment = new Comment { CreateDate = DateTime.Now, Post = new BlogPost { Id = request.PostId }, Text = request.Text };
     repository.AddComment(comment);
     Console.WriteLine("Добавлен коментарий: '{0}' от {1}", comment.Text, comment.CreateDate.ToString());
 }