Nullable Reference Types (NRT) are enabled by default in .NET 6 templates. It’s time to stop fighting the warnings and embrace the design philosophy. The Golden Rule “Design your types to be initialized fully on construction.” Most NRT warnings come from models that are partially initialized or set via property injection later. If a property […]
Read more โCategory: .NET
All .NET Related Stuffs goes here.
.NET 6: Minimal APIs Explained
Minimal APIs are the biggest shift in ASP.NET Core since version 1.0. They remove the MVC ceremony (Controllers, Actions, Filters) in favor of a fluent lambda-based syntax. The Code Is it just for tiny apps? No. Performance is technically better than MVC (fewer allocations, no Filter Pipeline overhead). However, organization becomes the challenge. You don’t […]
Read more โBuilding a GraphQL API with Hot Chocolate 11
Hot Chocolate is the premier GraphQL server for .NET. Version 11 brings “Zero Latency” execution engine improvements. Setup Projection The real power is in [UseProjection]. It translates nested GraphQL queries into optimized EF Core SQL queries (SELECT only what is requested).
Read more โDependency Injection in .NET: Service Lifetimes
Choosing the right lifetime for your services is critical for app correctness and memory usage. Transient Created every time it is requested. Lightweight, stateless services. Scoped Created once per HTTP request. Ideal for DB contexts, user session data. Don’t inject Scoped into Singleton! Singleton Created once per application lifetime. Examples: Caching services, configuration. MUST be […]
Read more โ.NET 6 Preview: What’s on the Roadmap
With .NET 5 shipped, Microsoft is effectively executing on its annual release cadence. .NET 6 is scheduled for November 2021. Based on GitHub issues and planning docs, here is what we can expect from the next Long Term Support (LTS) release. MAUI (Multi-platform App UI) The evolution of Xamarin.Forms into MAUI was delayed from .NET […]
Read more โBlazor WebAssembly Authentication with Azure AD
Securing a Single Page Application (SPA) can be tricky. Blazor WebAssembly makes it easier by providing built-in integration with OpenID Connect (OIDC) providers, including Azure Active Directory (AAD). Here is how to secure your app. App Registration First, register your app in the Azure Portal. 1. Create a “Single-page application” registration. 2. Set the Redirect […]
Read more โ