Skip to content

Instantly share code, notes, and snippets.

@ahjohannessen
Created April 25, 2011 23:19
Show Gist options
  • Save ahjohannessen/941468 to your computer and use it in GitHub Desktop.
Save ahjohannessen/941468 to your computer and use it in GitHub Desktop.
Func<Stream>
public Func<Stream> Execute()
{
var writer = new StringWriter();
var view = (SparkViewBase)_provider.GetView();
_partialOutput.SetWriter(() => view.Output);
view.Output = writer;
// something a la this:
return () =>
{
view.RenderView(writer);
var ms = new MemoryStream();
var sw = new StreamWriter(ms);
sw.Write(writer.ToString());
return ms;
}; // worry about the content type later
//_outputWriter.WriteHtml(writer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment