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;
 }
Пример #2
0
        public async Task <Dictionary <string, string> > Handle(GetProfilesQuery request, CancellationToken cancellationToken)
        {
            var result = new Dictionary <string, string>();

            Parallel.ForEach(applicationDBContexts, (db) =>
            {
                var profiles = db.Profiles.ToList();
                Parallel.ForEach(profiles, (profile) => { result.Add($"{db.GetType().Name} Id: { profile.Id}", profile.Name); });
            });
            return(result);
        }
Пример #3
0
        public void Should_retreive_profiles()
        {
            var profile1 = CreateProfile();
            var profile2 = CreateProfile();

            Save(profile1, profile2);

            var query   = new GetProfilesQuery(TestContext);
            var results = query.Execute();

            results.Any(p => p.ProfileName == profile1.ProfileName).ShouldBeTrue();
            results.Any(p => p.ProfileName == profile2.ProfileName).ShouldBeTrue();
        }
Пример #4
0
        public async Task <ActionResult <IEnumerable <GeekProfileResponse> > > GetProfiles([FromQuery] ProfilesResourceParameters prm)
        {
            var query = new GetProfilesQuery(prm.Limit, prm.Offset, prm.OrderBy, prm.OrderDirection);

            var(profiles, total) = await this.mediator.Send(query);

            var paginationMetadata = new
            {
                offset = prm.Offset,
                limit  = prm.Limit,
                total
            };

            Response.Headers.Add("X-Pagination", JsonSerializer.Serialize(paginationMetadata));

            return(this.Ok(profiles));
        }
        public void Should_retreive_profiles()
        {
            var profile1 = CreateProfile();
            var profile2 = CreateProfile();

            Save(profile1, profile2);

            List <Profile> results = null;

            Scoped <IUsersContext>(usersContext =>
            {
                var query = new GetProfilesQuery(usersContext);
                results   = query.Execute();
            });

            results.Any(p => p.ProfileName == profile1.ProfileName).ShouldBeTrue();
            results.Any(p => p.ProfileName == profile2.ProfileName).ShouldBeTrue();
        }
 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;
 }