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.

Console.WriteLine("hello world");
var i = 1
int result = numbers.Sum();
int result = numbers.Sum();int result = numbers.Sum();
int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();int result = numbers.Sum();
int result = numbers.Sum();
 public async Task<List<ManageCampaignViewModel>> Handle(AuthorizedCampaignsQuery message)
        {
            return await _context.CampaignManagers.Where(c => c.UserId == message.UserId)
                .Select(c => c.Campaign)
                .Where(c => !c.Locked && c.Published)
                .Select(campaign => new ManageCampaignViewModel
                {
                    Id = campaign.Id,
                    Description = campaign.Description,
                    EndDate = campaign.EndDateTime,
                    Featured = campaign.Featured,
                    ManagingOrganizationLogo = campaign.ManagingOrganization.LogoUrl,
                    ManagingOrganizationName = campaign.ManagingOrganization.Name,
                    Name = campaign.Name,
                    StartDate = campaign.StartDateTime
                })
                .ToListAsync();
        }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace JafraMia
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}
if(true)
  BackgroundJob.Enqueue(() => Debug.WriteLine("Hello world from Hangfire!"));
abc
Console.WriteLine("Hello world");
Console.WriteLine("dB Here");
Console.WriteLine(1+2);
 public async Task<List<ManageCampaignViewModel>> Handle(AuthorizedCampaignsQuery message)
        {
            return await _context.CampaignManagers.Where(c => c.UserId == message.UserId)
                .Select(c => c.Campaign)
                .Where(c => !c.Locked && c.Published)
                .Select(campaign => new ManageCampaignViewModel
                {
                    Id = campaign.Id,
                    Description = campaign.Description,
                    EndDate = campaign.EndDateTime,
                    Featured = campaign.Featured,
                    ManagingOrganizationLogo = campaign.ManagingOrganization.LogoUrl,
                    ManagingOrganizationName = campaign.ManagingOrganization.Name,
                    Name = campaign.Name,
                    StartDate = campaign.StartDateTime
                })
                .ToListAsync();
        }
 public async Task<List<ManageCampaignViewModel>> Handle(AuthorizedCampaignsQuery message)
        {
            return await _context.CampaignManagers.Where(c => c.UserId == message.UserId)
                .Select(c => c.Campaign)
                .Where(c => !c.Locked && c.Published)
                .Select(campaign => new ManageCampaignViewModel
                {
                    Id = campaign.Id,
                    Description = campaign.Description,
                    EndDate = campaign.EndDateTime,
                    Featured = campaign.Featured,
                    ManagingOrganizationLogo = campaign.ManagingOrganization.LogoUrl,
                    ManagingOrganizationName = campaign.ManagingOrganization.Name,
                    Name = campaign.Name,
                    StartDate = campaign.StartDateTime
                })
                .ToListAsync();
        }
        public async Task<List<ManageCampaignViewModel>> Handle(AuthorizedCampaignsQuery message)
        {
            return await _context.CampaignManagers.Where(c => c.UserId == message.UserId)
                .Select(c => c.Campaign)
                .Where(c => !c.Locked && c.Published)
                .Select(campaign => new ManageCampaignViewModel
                {
                    Id = campaign.Id,
                    Description = campaign.Description,
                    EndDate = campaign.EndDateTime,
                    Featured = campaign.Featured,
                    ManagingOrganizationLogo = campaign.ManagingOrganization.LogoUrl,
                    ManagingOrganizationName = campaign.ManagingOrganization.Name,
                    Name = campaign.Name,
                    StartDate = campaign.StartDateTime
                })
                .ToListAsync();
        }
namespace esos.TIMNet.Web.Areas.App.Controllers
{
    public class TasksController : AbpController
    {
        private IBackgroundJobAppService _backgroundJobService;

        public TasksController(IBackgroundJobAppService backgroundJobService)
        {
            _backgroundJobService = backgroundJobService;
        }
        public void Execute(int? id)
        {
            _backgroundJobService.ProcessStart((int)id);
        }

    }
}
ю
Hangfire.BackgroundJob.Schedule(() => Ejecutar(), TimeSpan.FromSeconds(30));

public void Ejecutar()
{
 Console.Write("basura");
}
using System;

namespace myApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}
        for (int i = 0; i < 5; i++)
        {
            Console.WriteLine("Sleep for 2 seconds.");
            Thread.Sleep(2000);
        }
if(  true
    && !false
    && false == !true
    && true == !!!!true
    && 0 == (1-1)
    && null == default(object)
    && "teste".Equals("teste|teste".split("|")[0])){
    return false;
}
if(  true
    && !false
    && false == !true
    && true == !!!!true
    && 0 == (1-1)
    && null == default(object)
    && "teste".Equals("teste|teste".split("|")[0])){
    return false;
}
if(true == true && false == false){
    return;
}
fasdadf
 return (level, func, exception, parameters) =>
                {
                    if (level >= Quartz.Logging.LogLevel.Trace && func != null)
                    {
                        Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters);
                    }
                    return true;
                };
Console.WriteLine(1+2);
Console.WriteLine("TEST");
test
Console.WriteLine("Hello, world!");
another test
This is a test
adfadsf
aaa
ErrorCodes
 return (level, func, exception, parameters) =>
                {
                    if (level >= Quartz.Logging.LogLevel.Trace && func != null)
                    {
                        Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters);
                    }
                    return true;
                };
 return (level, func, exception, parameters) =>
                {
                    if (level >= Quartz.Logging.LogLevel.Trace && func != null)
                    {
                        Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters);
                    }
                    return true;
                };
var x = 2;
var x = 100;
public IEnumerable<string> QueueGenerateAndDeliverNotificationJobs( IEnumerable<Notification> notifications, bool shouldDeliver )
		{
			if ( notifications == null )
			{
				throw new ArgumentNullException( nameof( notifications ) );
			}

			List<string> jobIDs = new List<string>();
			foreach ( Notification currentNotification in notifications )
			{
				jobIDs.Add( this.QueueGenerateAndDeliverNotificationJobs( currentNotification, shouldDeliver ) );
			}

			return jobIDs;
		}
Console.WriteLine("Hi IO");
Console.WriteLine("Hi IO");
public void Page_Losad(){
int blah = 1;
}
lala
private string Teste() { return "OLA DIACHO!" }
asdfasdf
private string Teste() { return "OLA DIACHO!" }
        private IEnumerable<IDisposable> GetHangfireServers()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["hangfire"].ToString();

            GlobalConfiguration.Configuration
                .SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
                .UseSimpleAssemblyNameTypeSerializer()
                .UseRecommendedSerializerSettings()
                .UseSqlServerStorage(connectionString, new SqlServerStorageOptions
                {
                    CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
                    SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
                    QueuePollInterval = TimeSpan.Zero,
                    UseRecommendedIsolationLevel = true,
                    UsePageLocksOnDequeue = true,
                    DisableGlobalLocks = true
                });

            yield return new BackgroundJobServer();
        }
ccccccc
Console.WriteLine("Hello, world!");