Share C# code with CodeThis

C# snippets with records, pattern matching, and LINQ — complete with async/await syntax highlighting.

Paste C# now

What you get

  • C#-aware syntax highlighting via CodeMirror
  • Instant shareable link — no signup required
  • Optional expiration (7 days, 30 days, permanent)
  • Password protection for private pastes
  • Works with the REST API and MCP server
  • Rich markdown and MDC components alongside code

Common use cases for C# pastes

  • ASP.NET controllers
  • LINQ one-liners
  • Minimal API samples
  • Unity component examples

Example

record Shape(double Width, double Height);

static double Area(Shape s) => s switch {
    { Width: 0 } or { Height: 0 } => 0,
    _ => s.Width * s.Height
};

Related languages

Ready to share some C#?