C#

Share C# code online.

Share C# classes, LINQ queries, or ASP.NET Core handlers: syntax-highlighted and shareable without a Microsoft account.

textdrop.sh/xk4mR2
1public sealed record CreateOrderCommand(2    Guid CustomerId,3    IReadOnlyList<OrderLineDto> Lines4);56public sealed class CreateOrderHandler(7    IOrderRepository orders,8    IUnitOfWork uow9) : IRequestHandler<CreateOrderCommand, Guid>10{11    public async Task<Guid> Handle(12        CreateOrderCommand cmd,13        CancellationToken ct)14    {15        var order = Order.Create(cmd.CustomerId, cmd.Lines16            .Select(l => new OrderLine(l.ProductId, l.Qty, l.UnitPrice)));1718        await orders.AddAsync(order, ct);19        await uow.CommitAsync(ct);20        return order.Id;21    }22}
Every paste includes

C# syntax highlighting

Paste C# code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share MediatR command handlers
  • 02Send Entity Framework LINQ queries
  • 03Share ASP.NET Core minimal API snippets
  • 04Distribute extension method libraries
  • 05Send async/await pattern examples
FAQ
Does the C# grammar support top-level statements and records?+

Yes. The grammar supports C# 12 including primary constructors, collection expressions, and inline arrays.

Can I share .cshtml Razor files?+

For Razor templates, paste as HTML: it will highlight the HTML structure reasonably well.

Is there a size limit?+

Pastes up to 5 MB are supported.

Other languages
Drop your code