Exemplo n.º 1
0
 /// <summary>
 /// 获取支付接口
 /// 不存在或已删除时返回null
 /// 结果会按接口Id缓存一定时间
 /// </summary>
 /// <param name="apiId">支付接口的Id</param>
 /// <returns></returns>
 public virtual PaymentApi GetPaymentApi(long apiId)
 {
     return(PaymentApiCache.GetOrCreate(apiId, () =>
                                        UnitOfWork.ReadData <PaymentApi, PaymentApi>(r => {
         return r.GetByIdWhereNotDeleted(apiId);
     }), PaymentApiCacheTime));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取支付接口
 /// 不存在或已删除时返回null
 /// 结果会按接口Id缓存一定时间
 /// </summary>
 /// <param name="apiId">支付接口的Id</param>
 /// <returns></returns>
 public virtual PaymentApi GetWithCache(Guid apiId)
 {
     return(PaymentApiCache.GetOrCreate(
                apiId, () => Get(apiId), PaymentApiCacheTime));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 清理缓存
 /// </summary>
 public void ClearCache()
 {
     PaymentApiCache.Clear();
     PaymentApisCache.Clear();
 }