This sample allows you to highlight C# source code. Highlighting is based on http://hilite.me web service, which is called from a background job in a truly asynchronous way – neither controller, nor any other entity is waiting for a completion. Results are delivered via WebSockets using SignalR.

All the snippets are removed every day at 12:00 AM UTC.

public ActionResult HighlightedCode(int snippetId)
{
    var snippet = _db.Snippets.Find(snippetId);
    if (snippet.HighlightedCode == null)
    {
        return new HttpStatusCodeResult(HttpStatusCode.NoContent);
    }

    return Content(snippet.HighlightedCode);
}
Console.WriteLine("");
class Test {

}
sdfdgd;
sdfdgd;
Console.WriteLine("sdfd");
Console.Writeln("JOhn");
Console.WriteLine("this is it!!!");
Console.WriteLine("this is it!!!");
Console.WriteLine("Hello, world!");
Console.WriteLine("Hello, world!");
Console.WriteLine("Hello3, world!");
Console.WriteLine("Hello, world!");