.NET developer

Stage 1 · Lesson 5 of 7

Records and pattern matching

C# and the .NET platform

are types built for data. public record OrderDto(int Id, decimal Total); gives you a constructor, read-only properties, value equality and a readable ToString, and with makes a changed copy. They are ideal for API requests and responses, events and value objects, but not for EF Core entities, which need rather than value equality.

tests the shape of a value: its type, a constant, a range or its properties. A switch expression turns a long if/else chain into a short list of cases, and the compiler warns when you miss an enum value. Fee rules, status transitions and discount tiers read much better this way.

Newer features such as and ([1, 2, 3]) also appear in modern code.

Common trapputting the catch-all _ case first, so nothing below it ever runs.

A question to check yourself, an AI practice session and 4 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • GuideFree
    Learn C#

    Microsoft · Beginner

    Free official C# path: syntax, types, classes, collections and exceptions with in-browser exercises

  • GuideFree
    .NET documentation

    Microsoft

    The official .NET docs: start with the CLI overview, project files and the C# language tour

Practise

  • The free C# track: small exercises with mentor feedback that build fluency fast

Keep handy

  • Searchable offline docs, handy for C# and .NET API lookups while you practise

Also worth your time

Mark this stage as not done?