public CanAccessApprenticeshipQueryHandlerTestsFixture SetMatchingAccountQuery()
 {
     Query = new CanAccessApprenticeshipQuery {
         ApprenticeshipId = _apprenticeshipId, Party = Party.Employer, PartyId = _accountId
     };
     return(this);
 }
 public CanAccessApprenticeshipQueryHandlerTestsFixture SetMatchingProviderQuery()
 {
     Query = new CanAccessApprenticeshipQuery {
         ApprenticeshipId = _apprenticeshipId, Party = Party.Provider, PartyId = _providerId
     };
     return(this);
 }
 public CanAccessApprenticeshipQueryHandlerTestsFixture SetNonMatchingQuery()
 {
     Query = new CanAccessApprenticeshipQuery {
         ApprenticeshipId = _apprenticeshipId + 1, Party = Party.Provider, PartyId = _accountId
     };
     return(this);
 }
        public async Task <IActionResult> CanAccessApprenticeship(ApprenticeshipAccessRequest request)
        {
            var query = new CanAccessApprenticeshipQuery
            {
                ApprenticeshipId = request.ApprenticeshipId,
                Party            = request.Party,
                PartyId          = request.PartyId
            };

            return(Ok(await _mediator.Send(query)));
        }