public ApiController(Dispatcher dispatcher, IAvailableSlotsRepository availableSlotsRepository, IEventStore eventStore) { _dispatcher = dispatcher; _availableSlotsRepository = availableSlotsRepository; _eventStore = eventStore; }
public SlotsController( IAvailableSlotsRepository availableSlotsRepository, IPatientSlotsRepository patientSlotRepository, Dispatcher dispatcher) { _availableSlotsRepository = availableSlotsRepository; _patientSlotRepository = patientSlotRepository; _dispatcher = dispatcher; }
public AvailableSlotsProjection(IAvailableSlotsRepository repo) { When <Scheduled>(e => { repo.Add(new AvailableSlot(e.SlotId, e.StartTime, e.Duration)); return(Task.CompletedTask); }); When <Booked>(e => { repo.MarkAsUnavailable(e.SlotId); return(Task.CompletedTask); }); When <Cancelled>(e => { repo.MarkAsAvailable(e.SlotId); return(Task.CompletedTask); }); }