Example #1
0
        public static void View <T>(this Response res, string view, T model, string viewEngineId)
        {
            var viewEngine = ViewEngineActivator.ResolveViewEngine(viewEngineId);
            var output     = viewEngine.Parse(view);

            res.ContentType = "text/html";
            res.Status      = "200 OK";
            res.End(output);
        }
Example #2
0
 public static IAppBuilder RegisterViewEngine(this IAppBuilder builder, Func <IViewEngine> viewEngine, string viewEngineId)
 {
     ViewEngineActivator.RegisterViewEngine(viewEngineId, viewEngine);
     return(builder);
 }