public DomainEventSerializationDouble(AppointmentDeleted appointmentDeletedEvent) : this((DomainEvent)appointmentDeletedEvent) { DomainEventType = EventType.Removed; RemovedAppointmentId = appointmentDeletedEvent.RemovedAppointmentId; }
private static void WriteEvent(XmlWriter writer, AppointmentDeleted @event) { writer.WriteStartElement(AppointmentDeletedEvent); writer.WriteAttributeString(AppointmentIdAttribute, @event.RemovedAppointmentId.ToString()); writer.WriteEndElement(); }
public override void Process(AppointmentDeleted domainEvent) { if (domainEvent.PatientId != patientId) { return; } appointmentSet.DeleteAppointment(domainEvent.RemovedAppointmentId); }
public override void Process(AppointmentDeleted domainEvent) { if (domainEvent.AggregateId != Identifier) { return; } if (AggregateVersion != domainEvent.AggregateVersion) { throw new VersionNotApplicapleException("@handle appointmentDeleted @readmodel"); } appointmentSet.DeleteAppointment(domainEvent.RemovedAppointmentId); AggregateVersion = domainEvent.AggregateVersion + 1; }
public void Process(DeleteAppointment command) { if (session.LoggedInUser == null) { errorCallback("commands can only be processed when a user is logged in"); return; } var deletedEvent = new AppointmentDeleted(command.AggregateId, command.AggregateVersion, session.LoggedInUser.Id, command.PatientId, TimeTools.GetCurrentTimeStamp(), command.ActionTag, command.RemovedAppointmentId); connectionService.TryAddEvents( addingWasSuccesscful => { if (!addingWasSuccesscful) { errorCallback("adding events failed"); } else { if (command.ActionTag == ActionTag.RegularAction) { patientRepository.RequestPatient(patient => { Application.Current.Dispatcher.Invoke(() => { session.ReportUserAction(userActionBuilder.BuildDeletedAction(command, patient)); }); }, command.PatientId, errorCallback); } } }, new List <DomainEvent> { deletedEvent }, errorCallback ); }
private void HandleDeletedEvent(AppointmentDeleted deletedEvent) { var appointmentToDelete = AppointmentData.First(appointment => appointment.Id == deletedEvent.RemovedAppointmentId); AppointmentData.Remove(appointmentToDelete); }
public abstract void Process(AppointmentDeleted domainEvent);
private bool TryToDeleteEvent(AppointmentDeleted deletedEvent) { return(eventStreamAggregator.AppointmentData.Any(appointment => appointment.Id == deletedEvent.RemovedAppointmentId)); }