public ApplicationController(IMapper mapper , IDeleteApplicationCommand deleteApplicationCommand , IAddApplicationCommand addApplicationCommand , IEditApplicationCommand editApplicationCommand , GetApplicationByIdQuery getApplicationByIdQuery , IGetVendorByIdQuery getVendorByIdQuery , GetClaimSetNamesQuery getClaimSetNamesQuery , GetProfilesQuery getProfilesQuery , RegenerateApiClientSecretCommand regenerateApiClientSecretCommand , IOdsApiFacadeFactory odsApiFacadeFactory , InstanceContext instanceContext , ITabDisplayService tabDisplayService , IOdsApiConnectionInformationProvider apiConnectionInformationProvider , IGetVendorsQuery getVendorsQuery) { _mapper = mapper; _deleteApplicationCommand = deleteApplicationCommand; _addApplicationCommand = addApplicationCommand; _editApplicationCommand = editApplicationCommand; _getApplicationByIdQuery = getApplicationByIdQuery; _getVendorByIdQuery = getVendorByIdQuery; _getClaimSetNamesQuery = getClaimSetNamesQuery; _getProfilesQuery = getProfilesQuery; _regenerateApiClientSecretCommand = regenerateApiClientSecretCommand; _odsApiFacadeFactory = odsApiFacadeFactory; _instanceContext = instanceContext; _tabDisplayService = tabDisplayService; _apiConnectionInformationProvider = apiConnectionInformationProvider; _getVendorsQuery = getVendorsQuery; }
internal Task <IResult> GetApplication(GetApplicationByIdQuery getApplicationByIdQuery, IMapper mapper, int id) { var application = getApplicationByIdQuery.Execute(id); if (application == null) { throw new NotFoundException <int>("application", id); } var model = mapper.Map <ApplicationModel>(application); return(Task.FromResult(AdminApiResponse <ApplicationModel> .Ok(model))); }
public async Task <IDataResult <ApplicationDto> > GetById(GetApplicationByIdQuery query) { var searchResult = await this.GetById(query.Id); var matchingApplication = searchResult.Results.FirstOrDefault()?.Document; if (matchingApplication == null) { return(new FailedDataResult <ApplicationDto>()); } var mapped = _mapper.Map <SearchableApplication, ApplicationDto>(matchingApplication); var validFor = TimeSpan.FromHours(_searchOptions.SharedAccessSignatureLifetimeInHours); var photoToken = _sharedAccessSignatureProvider.GetContainerSasUri(FileStore.PhotosContainer, validFor); var cvToken = _sharedAccessSignatureProvider.GetContainerSasUri(FileStore.CvsContainer, validFor); return(new SuccessfulDataResult <ApplicationDto>(this.EnrichDtoWithTokens(mapped, cvToken, photoToken))); }
public ApplicationController(IMapper mapper , IDeleteApplicationCommand deleteApplicationCommand , IAddApplicationCommand addApplicationCommand , IEditApplicationCommand editApplicationCommand , GetApplicationByIdQuery getApplicationByIdQuery , IGetVendorByIdQuery getVendorByIdQuery , GetClaimSetNamesQuery getClaimSetNamesQuery , GetProfilesQuery getProfilesQuery , RegenerateApiClientSecretCommand regenerateApiClientSecretCommand , IOdsApiFacadeFactory odsApiFacadeFactory , InstanceContext instanceContext) { _mapper = mapper; _deleteApplicationCommand = deleteApplicationCommand; _addApplicationCommand = addApplicationCommand; _editApplicationCommand = editApplicationCommand; _getApplicationByIdQuery = getApplicationByIdQuery; _getVendorByIdQuery = getVendorByIdQuery; _getClaimSetNamesQuery = getClaimSetNamesQuery; _getProfilesQuery = getProfilesQuery; _regenerateApiClientSecretCommand = regenerateApiClientSecretCommand; _odsApiFacadeFactory = odsApiFacadeFactory; _instanceContext = instanceContext; }