public void Handle(TodoCreatedEvent e) { this.AggregateId = e.AggregateId; this.Name = e.Name; this.Desception = e.Desception; this.FinishTime = e.FinishTime; }
public void AddTodo(string text) { var newTodoId = Guid.NewGuid(); var @event = new TodoCreatedEvent(Id, CurrentVersion, newTodoId, text); ApplyEvent(@event); }
public void Handle(TodoCreatedEvent @event) { ExecuteDomainUpdate(@event.Creater, user => { user.NewTodoAdded(@event.AggregateId); }); }
public void Apply(TodoCreatedEvent @event) { Id = @event.AggregateId; Title = @event.Title; Description = @event.Description; Creater = @event.Creater; CreateTime = DateTime.Now; }
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, }; }
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); }