/// <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)); }
/// <summary> /// 获取支付接口 /// 不存在或已删除时返回null /// 结果会按接口Id缓存一定时间 /// </summary> /// <param name="apiId">支付接口的Id</param> /// <returns></returns> public virtual PaymentApi GetWithCache(Guid apiId) { return(PaymentApiCache.GetOrCreate( apiId, () => Get(apiId), PaymentApiCacheTime)); }