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

Why Mongoose? — Introduction to Mongoose

BitCherry CEO: Blockchain Technology will transparent the public welfare

Performance Analysis: Virtualization Vs Containerization

Building Cloud-Native #GitOps on Google Cloud Platform

Advanced C++ Templates Tutorial

Mongock, Mongo and Java

5 things every pull request should have. Little thoughts from my experience.

Announcing Our Seed Investment in Suborbital

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

How to perform data-binding in Blazor

Access Modifiers in C#

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

Debugging 101 in Visual Studio 2022