Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the application domain objects.
        /// </summary>
        /// <returns>A task.</returns>
        public static async Task InitializeAsync()
        {
            if (Instance == null)
            {
                Instance = new ApplicationDomain();

                Instance.AzureStorageService = new AzureStorageService(ApplicationConfiguration.AzureStorageConnectionString, ApplicationConfiguration.AzureStorageConnectionEndpointSuffix);
                Instance.CachingService      = new CachingService(Instance, ApplicationConfiguration.CacheConnectionString);
                Instance.PartnerCenterClient = await AcquirePartnerCenterAccessAsync();

                Instance.PortalLocalization              = new PortalLocalization(Instance);
                Instance.OffersRepository                = new PartnerOffersRepository(Instance);
                Instance.MicrosoftOfferLogoIndexer       = new MicrosoftOfferLogoIndexer(Instance);
                Instance.PortalBranding                  = new PortalBranding(Instance);
                Instance.PaymentConfigurationRepository  = new PaymentConfigurationRepository(Instance);
                Instance.PreApprovedCustomersRepository  = new PreApprovedCustomersRepository(Instance);
                Instance.CustomerSubscriptionsRepository = new CustomerSubscriptionsRepository(Instance);
                Instance.CustomerPurchasesRepository     = new CustomerPurchasesRepository(ApplicationDomain.Instance);
                Instance.CustomerOrdersRepository        = new OrdersRepository(ApplicationDomain.Instance);
                Instance.TelemetryService                = new TelemetryService(Instance);
                Instance.CustomerRegistrationRepository  = new CustomerRegistrationRepository(ApplicationDomain.Instance);

                await Instance.PortalLocalization.InitializeAsync();

                await Instance.TelemetryService.InitializeAsync();
            }
        }
        /// <summary>
        /// Initializes the core application domain objects.
        /// </summary>
        /// <returns>A task.</returns>
        public static async Task BootstrapAsync()
        {
            if (Instance == null)
            {
                Instance = new ApplicationDomain();
                Instance.PartnerCenterClient = await AcquirePartnerCenterAccessAsync();

                Instance.PortalLocalization = new PortalLocalization(Instance);
                await Instance.PortalLocalization.InitializeAsync();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PortalBranding"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 public PortalBranding(ApplicationDomain applicationDomain) : base(applicationDomain)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PortalLocalization"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 public PortalLocalization(ApplicationDomain applicationDomain) : base(applicationDomain)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PreApprovedCustomersRepository"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 public PreApprovedCustomersRepository(ApplicationDomain applicationDomain) : base(applicationDomain)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentConfigurationRepository"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 public PaymentConfigurationRepository(ApplicationDomain applicationDomain) : base(applicationDomain)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TelemetryService"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 public TelemetryService(ApplicationDomain applicationDomain) : base(applicationDomain)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DomainObject"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 protected DomainObject(ApplicationDomain applicationDomain)
 {
     applicationDomain.AssertNotNull(nameof(applicationDomain));
     this.ApplicationDomain = applicationDomain;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CachingService"/> class.
 /// </summary>
 /// <param name="applicationDomain">An application domain instance.</param>
 /// <param name="cacheConnectionString">The cache connection string.</param>
 public CachingService(ApplicationDomain applicationDomain, string cacheConnectionString) : base(applicationDomain)
 {
     this.cacheConnectionString = cacheConnectionString;
     this.isCashingEnabled      = !string.IsNullOrWhiteSpace(this.cacheConnectionString);
 }