public async Task <DeletedViewModel> Handle(DeletedQuery request, CancellationToken cancellationToken) { _journeyInstance.ThrowIfNotCompleted(); var providerId = _journeyInstance.State.ProviderId; var liveApprenticeships = await _sqlQueryDispatcher.ExecuteQuery(new GetApprenticeshipsForProvider() { ProviderId = providerId }); return(new DeletedViewModel() { ApprenticeshipTitle = _journeyInstance.State.ApprenticeshipTitle, }); }
public async Task <DeletedViewModel> Handle(DeletedQuery request, CancellationToken cancellationToken) { _journeyInstance.ThrowIfNotCompleted(); var providerId = _journeyInstance.State.ProviderId; var liveTLevels = await _sqlQueryDispatcher.ExecuteQuery(new GetTLevelsForProvider() { ProviderId = providerId }); return(new DeletedViewModel() { TLevelName = _journeyInstance.State.TLevelName, HasOtherTLevels = liveTLevels.Count > 0, ProviderId = providerId, YourReference = _journeyInstance.State.YourReference }); }
private void ThrowIfFlowStateNotValid() { _journeyInstance.ThrowIfNotCompleted(); }