예제 #1
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));
 }
예제 #2
0
 public static Post CreateInstance(BlogId blogId, string title, string excerpt, string body, AuthorId authorId)
 {
     return(new Post(blogId, title, excerpt, body, authorId));
 }
예제 #3
0
 internal Post(BlogId blogId, string title, string excerpt, string body, AuthorId authorId)
     : this(blogId, IdHelper.GenerateId(), title, excerpt, body, authorId)
 {
 }