public ApiContext GetApiContext(bool acceptCached = true)
        {
            if (acceptCached && _apiContext != null)
            {
                return _apiContext;
            }
            ApiContext apiContext = new ApiContext(tenantId: TenantId, siteId: SiteId, masterCatalogId: MasterCatalogId, catalogId: CatalogId);
            _apiContext = apiContext;

            return apiContext;
        }
示例#2
0
		public IApiContext CloneWith(Action<IApiContext> contextModification)
		{
			var cloned = new ApiContext()
			{
				AppAuthClaim = (string)this.AppAuthClaim.Clone(),
				CatalogId = this.CatalogId,
				CorrelationId = this.CorrelationId,
				Currency = (string)this.Currency.Clone(),
				Date = (string)this.Date.Clone(),
				HMACSha256 = (string)this.HMACSha256.Clone(),
				Locale = (string)this.Locale.Clone(),
				MasterCatalogId = this.MasterCatalogId,
				SiteId = this.SiteId,
				SiteUrl = (string)this.SiteUrl.Clone(),
				Tenant = this.Tenant,
				TenantId = this.TenantId,
				TenantUrl = (string)this.TenantUrl.Clone(),
				UserAuthTicket = this.UserAuthTicket
			};

			contextModification(cloned);
			return cloned;
		}
示例#3
0
 public Home(ApiContext apiContext)
 {
     InitializeComponent();
     _apiContext = apiContext;
 }