Рет қаралды 4,528
Usually, when we see Blazor components, the C# code handling the interaction for the component template is placed below the template within the same .razor file.
However, there are other ways to implement Blazor components. I will show two alternative approaches to splitting the template and the C# code into separate files.
00:00 Introduction
00:30 Reasons for Separating Code and Template
02:18 The Code-Behind Solution
04:02 Dependency Injection in Code-Behind
05:42 Inheriting from ComponentBase
07:26 Conclusion
🔥 C#/.NET Bootcamp: The Fundamentals & more (Code FRIENDS10 for 10% OFF)*
claudiobernasconi.ch/dotnet-c...
📌 .NET Developer Roadmap
claudiobernasconi.ch/learn-do...
📌 KZbin Playlists:
The FREE Blazor Crash Course: • The FREE Blazor Crash ...
C# Programming: • How to Create Modern C...
✅ SUBSCRIBE FOR MORE VIDEOS
Subscribe: 🔔 claudiobernasconi.ch/Subscribe
🚀 CONNECT & SUPPORT
Twitter: / chbernasconic
Blog: claudiobernasconi.ch
Newsletter: claudiobernasconi.ch/newsletter
* Affiliate Link: I earn a small commission at no additional cost