Ejemplo n.º 1
0
        public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
        {
            var viewEngineResult = viewEngineCollection.FindView(endpoint);

            if (viewEngineResult == null) return;

            var viewBuilder = new StringBuilder();
            var writer = new StringWriter(viewBuilder);
            viewEngineResult.View.Render(new ViewContext(result), writer);

            outputWriter.Write(viewBuilder.ToString());
            outputWriter.WriteContentType(viewEngineResult.View.ContentType);
        }
Ejemplo n.º 2
0
 public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
 {
     outputWriter.Write(result.ToString());
     outputWriter.WriteContentType(ContentType.Text);
 }