public void ChangeName(string newName) { var @event = new EmployeeNameChangedEvent { EmployeeId = (Guid)this.Id, Name = newName }; Apply(@event); }
public void Handle(EmployeeNameChangedEvent @event) { PerformDbAction(x => { var employee = x.Query<EmployeeDetails>().Single(y => y.EmployeeId == @event.EmployeeId.ToString()); employee.Name = @event.Name; }); }