示例#1
0
        public async Task <string> ParseAsync <T>(string template, T model, bool isHtml = true)
        {
            var project = new InMemoryRazorLightProject();
            var engine  = new RazorLightEngineBuilder().UseProject(project).Build();

            return(await engine.CompileRenderStringAsync <T>(Guid.NewGuid().ToString(), template, model));
        }
示例#2
0
        public async Task <string> ParseAsync <T>(string template, T model, bool isHtml = true)
        {
            var project = new InMemoryRazorLightProject();
            var engine  = new EngineFactory().Create(project);

            return(await engine.CompileRenderAsync <T>(Guid.NewGuid().ToString(), template, model));
        }