WebApiContrib / WebApiContrib.Formatting.RazorViewEngine

MOVED HERE -> https://github.com/WebApiContrib/WebApiContrib.Formatting.Razor
https://github.com/WebApiContrib/WebApiContrib.Formatting.Razor
MIT License
6 stars 6 forks source link

Compile vs. Parse #7

Open TheCutter opened 11 years ago

TheCutter commented 11 years ago

Is there a reason why Compile & Run is used on every request!? If you change the implementation to use Parse its much faster!

private string GetParsedView(IView view, string viewTemplate)
{
    if (view.ModelType == null)
    {
        return _templateService.Parse(viewTemplate, view.ViewName);
    }

    return _templateService.Parse(viewTemplate, view.Model, view.ViewName);
}