Pro EP 58: Are you using required keyword with your properties ?

Muhammad Waseem
Become .NET Pro !
Aug 21, 2023

Since C# 11 we can add required keyword with our properties , it will force to initialize that property at the time of object creation.

There are few benefits of using it
- Less chance of error
- Get rid of validation code
- If something is essential make it required

Compiler will give error if you don’t initialize that property

Whenever you’re ready, there are 4 ways I can help you

  1. Subscribe to my Weekly .NET Newsletter of C#/.NET with 7000+ Software Engineers.
  2. Promote yourself to 7000+ subscribers by Sponsoring my Newsletter
  3. Download my eBook at Gum Road which contains 30+ .NET Tips (With 2800+ Downloads)
  4. To get 100+ free and paid resources for learning C# and .NET visit this GitHub Repository

--

--