init
This commit is contained in:
commit
ab2e20f7e1
72 changed files with 2000 additions and 0 deletions
25
Femto.Modules.Blog/Domain/Posts/Post.cs
Normal file
25
Femto.Modules.Blog/Domain/Posts/Post.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using Femto.Common.Domain;
|
||||
using Femto.Modules.Blog.Domain.Posts.Events;
|
||||
using Femto.Modules.Blog.Domain.Posts.Rules;
|
||||
|
||||
namespace Femto.Modules.Blog.Domain.Posts;
|
||||
|
||||
internal class Post : Entity
|
||||
{
|
||||
public Guid Id { get; private set; }
|
||||
public Guid AuthorId { get; private set; }
|
||||
public string Content { get; private set; } = null!;
|
||||
public IList<PostMedia> Media { get; private set; }
|
||||
|
||||
private Post() { }
|
||||
|
||||
public Post(Guid authorId,string content, IList<PostMedia> media)
|
||||
{
|
||||
this.Id = Guid.CreateVersion7();
|
||||
this.AuthorId = authorId;
|
||||
this.Content = content;
|
||||
this.Media = media;
|
||||
|
||||
this.AddDomainEvent(new PostCreated(this));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue