Ejemplo n.º 1
0
        /// <summary>
        /// Stock Method
        /// </summary>
        private async void StockErrorLogInfo()
        {
            var logInfoDataAccess = new LogInfoDataAccess();
            var cacheKey          = AppConfigurationHelper.GetAppSettings <CacheLogModel>("AppSettings:ErrorLogCache");

            cacheKey = string.IsNullOrEmpty(cacheKey?.Cachekey) ? new CacheLogModel {
                Cachekey = "ErrorLogCache", DatabaseNumber = 1
            } : cacheKey;
            long cacheListLength = RedisCacheHelper.GetListLength(cacheKey.Cachekey, cacheKey.DatabaseNumber);

            while (cacheListLength > 0)
            {
                var cacheModel = RedisCacheHelper.GetLastOneList <ErrorInfoLogModel>(cacheKey.Cachekey,
                                                                                     cacheKey.DatabaseNumber);
                await logInfoDataAccess.AddLogInfoAsync(cacheModel);

                cacheListLength = RedisCacheHelper.GetListLength(cacheKey.Cachekey, cacheKey.DatabaseNumber);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Stock method
        /// </summary>
        /// <param name="cacheModel"></param>
        private Task <int> StockErrorLogInfo(ErrorInfoLogModel cacheModel)
        {
            var logInfoDataAccess = new LogInfoDataAccess();

            return(logInfoDataAccess.AddLogInfoAsync(cacheModel));
        }