예제 #1
0
        public static void RenderView(this DirectControllerAction controllerAction, Stream contentStream, TextWriter writer)
        {
            var actionName     = controllerAction.ActionDescriptor.ActionName;
            var controllerName = controllerAction.ActionDescriptor.ControllerDescriptor.ControllerName;
            var virtualPath    = string.Format("~/Views/{0}/{1}.cshtml", controllerName, actionName);

            var view = new RazorViewSimulator(controllerAction.MvcApplication, new StreamVirtualContent(virtualPath, contentStream));

            controllerAction.RenderView(view, writer);
        }
예제 #2
0
        public void ExecuteResult(TextWriter writer)
        {
            var view = new RazorViewSimulator(_executionContext.MvcApplication, _virtualContent);

            ExecuteResult(view, writer);
        }