public void Handle(TodoCreatedEvent e)
 {
     this.AggregateId = e.AggregateId;
     this.Name        = e.Name;
     this.Desception  = e.Desception;
     this.FinishTime  = e.FinishTime;
 }
Exemple #2
0
        public void AddTodo(string text)
        {
            var newTodoId = Guid.NewGuid();
            var @event    = new TodoCreatedEvent(Id, CurrentVersion, newTodoId, text);

            ApplyEvent(@event);
        }
Exemple #3
0
 public void Handle(TodoCreatedEvent @event)
 {
     ExecuteDomainUpdate(@event.Creater, user =>
     {
         user.NewTodoAdded(@event.AggregateId);
     });
 }
Exemple #4
0
 public void Apply(TodoCreatedEvent @event)
 {
     Id          = @event.AggregateId;
     Title       = @event.Title;
     Description = @event.Description;
     Creater     = @event.Creater;
     CreateTime  = DateTime.Now;
 }
Exemple #5
0
 public void Create(TodoCreatedEvent eventInformation)
 {
     this.Id                   = eventInformation.AggregateId;
     this.CreationDate         = eventInformation.Date;
     this.LastModificationDate = eventInformation.Date;
     this.Text                 = eventInformation.Text;
     this.Name                 = eventInformation.Text?.Substring(0, Math.Min(eventInformation.Text.Length, 64)) ?? string.Empty;
     this.TodoList             = new TodoTodoList
     {
         Id   = eventInformation.TodoListId,
         Name = eventInformation.TodoListName,
     };
 }
Exemple #6
0
 public void Apply(TodoCreatedEvent @event)
 {
     Title       = @event.Title;
     Description = @event.Description;
     Creater     = @event.Creater;
 }
        public void OnTodoCreated(TodoCreatedEvent @event)
        {
            var todo = new Todo(@event.TodoId, @event.Text);

            Todos.Add(todo);
        }
        public void AddTodo(Guid newTodoId, string text)
        {
            var @event = new TodoCreatedEvent(Id, CurrentVersion, newTodoId, text);

            ApplyEvent(@event);
        }