public Comment(Guid postId, string body, AuthorId authorId) : base(postId) { Body = body; AuthorId = authorId; CreatedAt = DateTimeHelper.GenerateDateTime(); }
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)); }
public static Post CreateInstance(BlogId blogId, string title, string excerpt, string body, AuthorId authorId) { return(new Post(blogId, title, excerpt, body, authorId)); }
public Post AddComment(string body, AuthorId authorId) { Comments.Add(new Comment(body, authorId)); return(this); }
internal Post(BlogId blogId, string title, string excerpt, string body, AuthorId authorId) : this(blogId, IdHelper.GenerateId(), title, excerpt, body, authorId) { }
public Comment(string body, AuthorId authorId) : this(IdHelper.GenerateId(), body, authorId) { }