---
title: "What is the difference between record and class in C#?"  
description: "What is the difference between record and class in C#?"  
author: "Mariana Medina"  
published: 2026-11-13  
updated: 2026-11-13  
canonical: https://www.mindstick.com/forum/163007/what-is-the-difference-between-record-and-class-in-c  
category: "C# and .NET"  
tags: ["c#", "record", "class", "immutability", "value equality"]  
reading_time: 1 minute  

---

# What is the difference between record and class in C#?

C# 9 introduced records. Are they just a shorter way to write a class, or is there a real difference?

## Replies

### Reply by Madison Ross

A record is still a reference type (unless you write `record struct`), but the compiler gives it extra behaviour:

- **Value equality**: two records with the same property values are equal. Two class instances are equal only if they are the same object, unless you write Equals yourself.
- **Readable ToString** that prints the property values, useful when debugging.
- **Non-destructive copy** with the `with` keyword: `var b = a with { Name = "New" };`
- A short positional syntax: `public record Person(string Name, int Age);`

Use records for data that is mostly about values: DTOs, API responses, messages, value objects. Use a normal class for things with identity and behaviour that changes over time, such as an EF Core entity with navigation properties and tracked changes.


---

Original Source: https://www.mindstick.com/forum/163007/what-is-the-difference-between-record-and-class-in-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
