Beispiel #1
0
 public Comment(Guid postId, string body, AuthorId authorId)
     : base(postId)
 {
     Body      = body;
     AuthorId  = authorId;
     CreatedAt = DateTimeHelper.GenerateDateTime();
 }
Beispiel #2
0
 internal Post(BlogId blogId, Guid postId, string title, string excerpt, string body, AuthorId authorId)
     : base(postId)
 {
     Blog      = blogId;
     Title     = title;
     Excerpt   = excerpt;
     Slug      = title.GenerateSlug();
     Body      = body;
     Author    = authorId;
     CreatedAt = DateTimeHelper.GenerateDateTime();
     Events.Add(new PostCreated(postId));
 }
Beispiel #3
0
 public static Post CreateInstance(BlogId blogId, string title, string excerpt, string body, AuthorId authorId)
 {
     return(new Post(blogId, title, excerpt, body, authorId));
 }
Beispiel #4
0
 public Post AddComment(string body, AuthorId authorId)
 {
     Comments.Add(new Comment(body, authorId));
     return(this);
 }
Beispiel #5
0
 internal Post(BlogId blogId, string title, string excerpt, string body, AuthorId authorId)
     : this(blogId, IdHelper.GenerateId(), title, excerpt, body, authorId)
 {
 }
Beispiel #6
0
 public Comment(string body, AuthorId authorId)
     : this(IdHelper.GenerateId(), body, authorId)
 {
 }