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; } }
public int CacheLifeSpecifier(ApiClientCustomerGetByPKContext context) { return(UseCache ? context.Response.Data.RemainingLife * 60 - 5:0); }
// GetByPK public string CacheKeySpecifier(ApiClientCustomerGetByPKContext context) { return(UseCache? context.Request.Id.ToString():""); }
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))); }
public override void Run(ApiClientCustomerGetByPKContext context) { ExecuteSingle(context, Service.CacheKeySpecifier, Service.CacheLifeSpecifier, (cc) => hubService.IsValidHub(cc.ApiClientCustomerHubId, "Customer" + context.Request.Id)); }