Пример #1
0
        public static CreationResult <Post> Create(PostCreateCommand command)
        {
            var newGuid          = Guid.NewGuid();
            var post             = new Post(newGuid, command);
            var createEvent      = new PostCreateEvent(post, newGuid);
            var domainEventBases = new List <DomainEventBase>();

            domainEventBases.Add(createEvent);
            return(CreationResult <Post> .OkResult(domainEventBases, post));
        }
Пример #2
0
        public static CreationResult <Post> Create(PostCreateCommand command)
        {
            // TODO: Implement this method;
            var newGuid = Guid.NewGuid();
            var entity  = new Post(newGuid, command);

            return(CreationResult <Post> .OkResult(new List <DomainEventBase> {
                new PostCreateEvent(entity, newGuid)
            }, entity));
        }
Пример #3
0
 private Post(Guid Id, PostCreateCommand command)
 {
     this.Title = command.Title;
     this.Id    = Id;
 }