Пример #1
0
        private static ICompiledTemplate GetFromCache(string filePath)
        {
            string cacheKey = "{0}::{1}".FormatString(CacheKey, filePath);

            ICache          cache  = Container.Get <ICache>();
            ITemplateEngine engine = Container.Get <ITemplateEngine>();

            ICompiledTemplate compiledTemplate = cache.Get <ICompiledTemplate>(cacheKey);

            if (compiledTemplate == null)
            {
                compiledTemplate = engine.CompileFile(filePath);

                cache.Set(cacheKey, compiledTemplate, filePath);
            }

            return(compiledTemplate);
        }