Esempio n. 1
0
        private void Finalize(ApiClientCustomerActivateContext context, ApiClientCustomerGetByPKContext ctx)
        {
            context.Request.CallContext.Customer = ctx.Response.Data;

            if (ctx.Response.Success && ctx.Response.Data != null)
            {
                context.Response.Data = new ApiClientCustomerActivateResponseData();

                context.Response.Data.AccessToken    = ctx.Response.Data.AccessToken;
                context.Response.Data.RefreshToken   = ctx.Response.Data.RefreshToken;
                context.Response.Data.EncryptionCode = ctx.Response.Data.EncryptionCode;
                context.Response.Data.LifeLength     = ctx.Response.Data.LifeLength;

                Service.CacheRemove(context);

                context.Request.CallContext.Customer.EncryptionCode.Value = context.Response.OldEncryptionCode;
            }
        }
Esempio n. 2
0
 public int CacheLifeSpecifier(ApiClientCustomerGetByPKContext context)
 {
     return(UseCache ? context.Response.Data.RemainingLife * 60 - 5:0);
 }
Esempio n. 3
0
 // GetByPK
 public string CacheKeySpecifier(ApiClientCustomerGetByPKContext context)
 {
     return(UseCache? context.Request.Id.ToString():"");
 }
Esempio n. 4
0
 public override async Task RunAsync(ApiClientCustomerGetByPKContext context)
 {
     await ExecuteSingleAsync(context, Service.CacheKeySpecifier, Service.CacheLifeSpecifier, (cc) => Task.FromResult(hubService.IsValidHub(cc.ApiClientCustomerHubId, "Customer" + context.Request.Id)));
 }
Esempio n. 5
0
 public override void Run(ApiClientCustomerGetByPKContext context)
 {
     ExecuteSingle(context, Service.CacheKeySpecifier, Service.CacheLifeSpecifier, (cc) => hubService.IsValidHub(cc.ApiClientCustomerHubId, "Customer" + context.Request.Id));
 }