public void AddBlogPost(int blogId, string title)
        {
            int    id   = Repository.Add(new BlogPost(blogId, title));
            IEvent evnt = new BlogPostAdded(id, blogId, title);

            Raise(evnt);
        }
예제 #2
0
        public void BlogPostAdded(string @event)
        {
            BlogPostAdded data = DeserializeEvent <BlogPostAdded>(@event);

            Console.WriteLine($"Added BlogPost {data.Id} to Blog {data.BlogId}");
        }
예제 #3
0
파일: Blog.cs 프로젝트: lulzzz/DblDip
 public void When(BlogPostAdded blogPostAdded)
 {
     _posts.Add(new(blogPostAdded.PostId, blogPostAdded.Title));
 }