public void Handle(DepartmentInsertedEvent @event) { Id = @event.AggregateId; AddedBy = @event.AddedBy; AddedDate = @event.AddedDate; Description = @event.Description; ImageUrl = @event.ImageUrl; Importance = @event.Importance; Title = @event.Title; }
public Department( Guid Id, DateTime AddedDate, string AddedBy, string Title, int Importance, string Description, string ImageUrl) { var @event = new DepartmentInsertedEvent { AggregateId = Id, AddedBy = AddedBy, AddedDate = AddedDate, Title = Title, Importance = Importance, Description = Description, ImageUrl = ImageUrl }; ApplyChange(@event); }