C# 9.0 - record

class Program{public class Employee{public string? EmployeeId { get; set; }public string? EmployeeName { get; set; }}static void Main(string[] args){Employee employee = new Employee { EmployeeId = “123”, EmployeeName = “Vaibhav” };employee.EmployeeName = “Testing Mutable Property”;Console.WriteLine(employee.EmployeeName);}}
class Program{public record Employee(string EmployeeId,string EmployeeName);static void Main(string[] args){Employee employee = new Employee(“123”,”Vaibhav”);Console.WriteLine(employee.EmployeeName);}}
Value-Based Equality Check
Immutability Check
With Expression Check
Inheritance

--

--

--

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Use Async / Await in Go

J&T Tracking — AGOGOPOST

🔝HOW TO LEVEL UP YOUR ANGELS?

Web3Graph Activator Campaign

Changing S3 objects’ metadata in bulk after upload, using boto3

The power of one is smarter than the pieces of many.?

Deepvariant Deploy

Running Camel standalone

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vaibhav Bhapkar

Vaibhav Bhapkar

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *

More from Medium

Fixing my BF1942 woes with Win32 APIs

C# How to make WPF TextBox accept only numeric inputs?

EF Core (5/6) — Check for Reference Properties exist in Many to One Relationship

C# conversions: Implicit VS Explicit