什么是一个控制台应用程序中产生的ASP.NET剃刀模板HTML目前最好的解决办法? [英] What's the current best solution for generating HTML from ASP.NET Razor templates within a Console Application?

查看:128
本文介绍了什么是一个控制台应用程序中产生的ASP.NET剃刀模板HTML目前最好的解决办法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样做:

 字符串模板=您好@ Model.Name欢迎剃刀!
字符串结果= Razor.Parse(模板,新{名称=世界});

和似乎 HTTP://razorengine.$c$cplex.com 是完美的,除了它的一岁

编辑:原来,RazorEngine已经转移到GitHub上,并已提交了几个月回: https://github.com/Antaris/ RazorEngine

我注意到,服务栈有一定的剃刀自托管,但同时,这里有一个很长的网页。 http://razor.servicestack.net 有没有世界你好,你完全可以从一个控制台做到这一点。

什么是控制台应用程序?

距离ASP.NET剃刀模板生成HTML目前最好的解决办法
解决方案

  

什么是从ASP.NET生成HTML目前最好的解决办法
  控制台应用程序内剃刀模板?


RazorEngine 。句号。

I want to do this:

string template = "Hello @Model.Name! Welcome to Razor!";
string result = Razor.Parse(template, new { Name = "World" });

And it appears that http://razorengine.codeplex.com is perfect, except it's a year old.

EDIT: Turns out that RazorEngine has moved to GitHub and had a commit a few months back: https://github.com/Antaris/RazorEngine

I noticed that Service Stack has some Razor self-hosting but while there's a long page here http://razor.servicestack.net there's no "hello world you can totally do this from a console."

What's the current best solution for generating HTML from ASP.NET Razor templates within a Console Application?

解决方案

What's the current best solution for generating HTML from ASP.NET Razor templates within a Console Application?

RazorEngine. Full stop.

这篇关于什么是一个控制台应用程序中产生的ASP.NET剃刀模板HTML目前最好的解决办法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆