What is a record?

A record is a type that makes it easier to create immutable reference types and provides equality comparisons.

Syntax

public record Student(string Name, string Assignment, int Grade);

Instantiating a record

Let’s create an object of the record class.

Get hands-on with 1400+ tech skills courses.