Ejemplo n.º 1
0
        public string Render(string viewPath)
        {
            var template = _viewFileReader.Read(viewPath);
            var view     = _razorEngine.RunCompile(template, viewPath);

            return(view);
        }
Ejemplo n.º 2
0
        public ITemplateSource Resolve(ITemplateKey key)
        {
            var templateKey = key as NameOnlyTemplateKey;

            if (templateKey == null)
            {
                throw new NotSupportedException("You can only use NameOnlyTemplateKey with this manager");
            }

            var template = _viewFileReader.Read(templateKey.Name);

            return(new LoadedTemplateSource(template, templateKey.Name));
        }