public SecretService(IHttpClientFactory HttpClientFactory, NavigationManager navigationManager, LocalConfigurations settings)
 {
     this._navManager = navigationManager;
     this._settings   = settings;
     this.KeyvaultUrl = _settings.Keyvault.KeyvaultUrl;
     this._http       = HttpClientFactory.CreateClient(_settings.Keyvault.ApiClientName);
 }
 public KeyvaultAPIAuthorizationMessageHandler(IAccessTokenProvider provider, NavigationManager navigationManager, LocalConfigurations settings) : base(provider, navigationManager)
 {
     this._settings = settings;
     ConfigureHandler(
         authorizedUrls: new[] { _settings.Keyvault.APIBaseUrl },
         scopes: new[] { string.Format("{0}/{1}", _settings.Keyvault.APIApplicationId, _settings.Keyvault.ApiScope) });
 }
Example #3
0
 private void AddHttpClient(IServiceCollection services)
 {
     services.AddHttpClient <IRESTFulApiFactoryClient, RESTFulApiFactoryClient>(client =>
     {
         LocalConfigurations localConfigurations = Configuration.Get <LocalConfigurations>();
         string apiUrl      = localConfigurations.ApiConfigurations.Url;
         client.BaseAddress = new Uri(apiUrl);
     });
 }
Example #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            services.AddScoped <IStudentService, StudentService>();

            services.AddRazorPages(options =>
            {
                options.RootDirectory = "/Views/Pages";
            });

            services.AddHttpClient <IRESTFulApiFactoryClient, RESTFulApiFactoryClient>(client =>
            {
                LocalConfigurations localConfigurations = Configuration.Get <LocalConfigurations>();
                string apiUrl      = localConfigurations.ApiConfigurations.Url;
                client.BaseAddress = new Uri(apiUrl);
            });
        }
Example #5
0
        public void ConfigureServices(IServiceCollection services)
        {
            //add blazorstrap
            services.AddBootstrapCss();

            services.AddRazorPages();
            services.AddServerSideBlazor();


            AddServices(services);

            services.AddSingleton <IApiBroker, ApiBroker>();

            services.AddHttpClient <IRESTFulApiFactoryClient, RESTFulApiFactoryClient>(client =>
            {
                LocalConfigurations localConfigurations = Configuration.Get <LocalConfigurations>();
                string apiUrl      = localConfigurations.ApiConfigurations.Url;
                client.BaseAddress = new Uri(apiUrl);
            });

            AddAuthServices(services);
        }
Example #6
0
        private void RegisterInstances()
        {
            //test
            resources      = new LocalizedStrings();
            configurations = new LocalConfigurations();
            ContainerBuilder builder = new ContainerBuilder();

            builder.RegisterType <RememberPasswordPageViewModel>().As <IRememberPasswordPageViewModel>().SingleInstance();
            builder.RegisterType <BeneficiariesPageViewModel>().As <IBeneficiariesPageViewModel>().SingleInstance();
            builder.RegisterType <ChangePasswordPageViewModel>().As <IChangePasswordPageViewModel>().SingleInstance();
            builder.RegisterType <ChangeEmailPageViewModel>().As <IChangeEmailPageViewModel>().SingleInstance();
            builder.RegisterType <DisableAccountPageViewModel>().As <IDisableAccountPageViewModel>().SingleInstance();
            builder.RegisterType <MenuPageViewModel>().As <IMenuPageViewModel>().SingleInstance();
            builder.RegisterType <SubMenuItemViewModel>().As <ISubMenuItemViewModel>().SingleInstance();
            builder.RegisterType <PersonalDataPageViewModel>().As <IPersonalDataPageViewModel>().SingleInstance();

            builder.RegisterType <ApiService>().As <IApiService>().SingleInstance();
            builder.RegisterType <CoordinationViewModel>().As <ICoordinationViewModel>().SingleInstance();
            builder.RegisterType <DialogService>().As <IDialogService>().SingleInstance();
            builder.RegisterType <LandingPageViewModel>().As <ILandingPageViewModel>().SingleInstance();
            builder.RegisterType <LoginPageViewModel>().As <ILoginPageViewModel>().SingleInstance();
            builder.RegisterType <LoginViewModel>().As <ILoginViewModel>().SingleInstance();
            builder.RegisterType <MedicalCenterCoordinationPageViewModel>().As <IMedicalCenterCoordinationPageViewModel>().SingleInstance();
            builder.RegisterType <NavigationService>().As <INavigationService>().SingleInstance();
            builder.RegisterType <NearbyClinicsPageViewModel>().As <INearbyClinicsPageViewModel>().SingleInstance();
            builder.RegisterType <NetworkService>().As <INetworkService>().SingleInstance();
            builder.RegisterType <NewMedicalCenterCoordinationPageViewModel>().As <INewMedicalCenterCoordinationPageViewModel>().SingleInstance();
            builder.RegisterType <RegisterPageViewModel>().As <IRegisterPageViewModel>().SingleInstance();
            builder.RegisterType <CallViewModel>().As <ICallViewModel>().SingleInstance();
            builder.RegisterType <CallMedicalCenterViewModel>().As <ICallMedicalCenterViewModel>();
            builder.RegisterType <PQRSPageViewModel>().As <IPQRSPageViewModel>().SingleInstance();
            builder.RegisterType <GeolocatorService>().As <IGeolocatorService>().SingleInstance();
            builder.RegisterType <PrecallViewModel>().As <IPrecallViewModel>().SingleInstance();
            builder.RegisterType <EvaluateVideoCallViewModel>().As <IEvaluateVideoCallViewModel>().SingleInstance();
            builder.RegisterType <QueuingViewModel>().As <IQueuingViewModel>().SingleInstance();
            builder.RegisterType <SurveyQueuingViewModel>().As <ISurveyQueuingViewModel>().SingleInstance();

            builder.RegisterInstance(DependencyService.Get <IPhoneService>());
            builder.RegisterInstance(DependencyService.Get <INotificationService>());
            builder.RegisterInstance(DependencyService.Get <IFileService>());
            builder.RegisterInstance(DependencyService.Get <ICloseApplication>());
            builder.RegisterInstance(DependencyService.Get <IQueingFirebaseService>());

            builder.RegisterType <AddFamilyPageViewModel>().As <IAddFamilyPageViewModel>().SingleInstance();
            builder.RegisterType <SearchFamilyPageViewModel>().As <ISearchFamilyPageViewModel>().SingleInstance();
            builder.RegisterType <PersonViewModel>().As <IPersonViewModel>().SingleInstance();
            builder.RegisterType <FamilyPageViewModel>().As <IFamilyPageViewModel>().SingleInstance();
            builder.RegisterType <LegalContentPageViewModel>().As <ILegalContentPageViewModel>().SingleInstance();
            builder.RegisterType <FaqsPageViewModel>().As <IFaqsPageViewModel>().SingleInstance();
            builder.RegisterType <FaqCompleteViewModel>().As <IFaqCompleteViewModel>().SingleInstance();
            builder.RegisterType <ServicesHistoryPageViewModel>().As <IServicesHistoryPageViewModel>().SingleInstance();
            builder.RegisterType <NotificationsPageViewModel>().As <INotificationsPageViewModel>().SingleInstance();
            builder.RegisterType <CertificatesPageViewModel>().As <ICertificatesPageViewModel>().SingleInstance();
            builder.RegisterType <ChatCustomerServicePageViewModel>().As <IChatCustomerServicePageViewModel>().SingleInstance();
            builder.RegisterType <ExceptionService>().As <IExceptionService>().SingleInstance();
            builder.RegisterType <ScheduledServicesPageViewModel>().As <IScheduledServicesPageViewModel>().SingleInstance();
            builder.RegisterType <FileSelectService>().As <IFileSelectService>().SingleInstance();
            builder.RegisterType <QualifyServicesPageViewModel>().As <IQualifyServicesPageViewModel>().SingleInstance();
            builder.RegisterType <LoaderPageViewModel>().As <ILoaderPageViewModel>().SingleInstance();
            builder.RegisterType <SettingsService>().As <ISettingsService>().SingleInstance();
            builder.RegisterType <ServicesPageViewModel>().As <IServicesPageViewModel>().SingleInstance();
            builder.RegisterType <ValidatorService>().As <IValidatorService>().SingleInstance();
            builder.RegisterType <AddressViewModel>().As <IAddressViewModel>().SingleInstance();
            builder.RegisterType <PdfPageViewModel>().As <IPdfPageViewModel>().SingleInstance();
            builder.RegisterType <ProductsAndPlansPageViewModel>().As <IProductsAndPlansPageViewModel>().SingleInstance();
            builder.RegisterType <PermissionService>().As <IPermissionService>().SingleInstance();
            builder.RegisterType <InvoicesPageViewModel>().As <IInvoicesPageViewModel>().SingleInstance();
            builder.RegisterType <InvoiceDetailPageViewModel>().As <IInvoiceDetailPageViewModel>().SingleInstance();
            builder.RegisterType <CurrentServiceViewViewModel>().As <ICurrentServiceViewViewModel>().SingleInstance();
            builder.RegisterType <VideoCallPageViewModel>().As <IMedicalVideoCallViewModel>().SingleInstance();
            builder.RegisterType <EditPasswordPageViewModel>().As <IEditPasswordPageViewModel>().SingleInstance();
            builder.RegisterType <UserInactiveViewModel>().As <IUserInactiveViewModel>().SingleInstance();
            builder.RegisterType <CardsPageViewModel>().As <ICardsPageViewModel>().SingleInstance();
            builder.RegisterType <ExpiredMedicalServicesPageViewModel>().As <IExpiredMedicalServicesPageViewModel>().SingleInstance();
            builder.RegisterType <RegisterMinorPageViewModel>().As <IRegisterMinorPageViewModel>().SingleInstance();
            builder.RegisterType <ContingencyMessagePageViewModel>().As <IContingencyMessagePageViewModel>().SingleInstance();
            var container = builder.Build(ContainerBuildOptions.None);

            ServiceLocator.SetLocatorProvider(() => new AutofacServiceLocator(container));
        }