Get the source code for this video for FREE → https://the-dotnet-weekly.ck.page/sma...
☄️ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: / milanjovanovic
Enums are a great way to improve readability in your code. But enums in C# have a minor problem - you can't add behavior to enum elements. You can only work with enum values. In this, I will show you how you can create a custom smart enum implementation that can contain behavior.
Join my weekly .NET newsletter:
https://www.milanjovanovic.tech
Read my Blog here:
https://www.milanjovanovic.tech/blog
Subscribe for more:
https://www.youtube.com/c/MilanJovano...
Chapters
0:00 The problem with C# enums
1:16 Creating the Enumeration class
5:11 Implementing Enumeration in CreditCard
8:44 Completing Enumeration implementation
13:17 Adding logic to CreditCard enum
Watch video How To Create Smart Enums in C# With Rich Behavior online, duration hours minute second in high quality that is uploaded to the channel Milan Jovanović 08 November 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 54,771 times and liked it 2 thousand visitors.