Convert ANY Of Your C# Types Without Casting Using Implicit Operators
Channel: Dev Leader
Date: 2024-03-06

C# is a strongly-typed language, and if we want to convert between various types in our code, we're often required to use explicit casting operators. This expresses that we want to go from one type to another very explicitly to readers of our code, and the compiler.

But what if we want to be able to convert between types without casting? We can leverage implicit operators in C# to do this -- but we need to be aware of the pros and cons of doing so!

----
Chapters:
0:00 - Intro
0:37 - Disclaimer
2:16 - How to Implement Implicit Operators
4:32 - The Example Code
6:11 - Summary
----
🔑 Membership & Subscriptions:
- 📨 Weekly Newsletter: https://subscribe.devleader.ca
- 🏘️ Private Discord Community: https://discord.com/invite/TVY79BZ3Wy
- 📽️ YouTube Membership: https://www.youtube.com/@devleader/join

🧠 Courses:
- All Courses: https://www.devleader.ca/courses
- Getting Started with C#: https://dometrain.com/course/getting-started-csharp?affcode=1115529_nl-teyzg
- Refactoring For C# Devs: https://dometrain.com/course/from-zero-to-hero-refactoring-for-csharp-developers?affcode=1115529_nl-teyzg
- [FREE] Intro to Software Development: https://www.youtube.com/playlist?list=PLzATctVhnsggb3lj53T8fJSK6LJQFUyKS

🗣️ Social Media & Links:
- All My Links: https://linktr.ee/devleader
- Blog: https://www.devleader.ca/
- TikTok: https://www.tiktok.com/@devleader
- LinkedIn: https://www.linkedin.com/in/nickcosentino
- Threads: threads.net/@dev.leader
- Twitter: https://twitter.com/DevLeaderCa
- Facebook: https://www.facebook.com/DevLeaderCa
- Instagram: https://www.instagram.com/dev.leader
- GitHub: https://github.com/ncosentino/
- Twitch: https://www.twitch.tv/ncosentino
- YouTube: https://youtube.com/@DevLeader?sub_confirmation=1

❤️ Affiliations & Products/Services That I Love:
- VPS hosting from RackNerd: https://my.racknerd.com/aff.php?aff=9013
- VPS hosting from Contabo: https://www.jdoqocy.com/click-101028632-12454592
- My newsletter platform ConverKit: https://convertkit.com/?lmref=c5X7KQ
- My newsletter referral system SparkLoop: https://dash.sparkloop.app/signup?aff=9fe76c8b
- My AI shorts helper Opus Clip: https://opus.pro/?via=2f9e97
- I try to help answer questions at Quora: https://www.quora.com/quoraplus?ch=10&invite_code=e7QLQ5pQgfBtLTOV&share=2ef9cd85
- My favorite computer parts store Newegg: https://click.linksynergy.com/fs-bin/click?id=uxaXetuYo*0&offerid=1207190.3&bids=1207190.3&type=3&subid=0
- My favorite supplement store Bulk Supplements: https://glnk.io/63qn/devleader
----

#dotnet #csharp #dotnetcore #coding #programming