Beispiel #1
0
        public void Execute(StaffAssignedToAppointment @event)
        {
            Printer.Print("Updating JobView in effect of StaffAssignedToAppointment event", ConsoleColor.Magenta);

            var staffRepository = new MyRepository <StaffMember>();
            var staff           = staffRepository.Fetch(@event.StaffId);

            var jobViewRepository = new MyRepository <JobView>();
            var jobView           = jobViewRepository.FetchAll().Single(j => j.Appointments.Any(a => a.Id == @event.AppointmentId));

            jobView.Appointments.Single(a => a.Id == @event.AppointmentId).AssignedTo = staff.Name;

            jobViewRepository.Update(jobView);

            Publish(jobView);
        }
Beispiel #2
0
 public void Handle(StaffAssignedToAppointment @event)
 {
     StaffMemberId = @event.StaffId;
 }