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: Microsoft
Microsoft Corporation (NASDAQ: MSFT) is an American multinational corporation headquartered in Redmond, Washington, United States that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions. Established on April 4, 1975 to develop and sell BASIC interpreters for the Altair 8800, Microsoft rose to dominate the home computer operating system market with MS-DOS in the mid-1980s, followed by the Microsoft Windows line of operating systems.
Microsoft would also come to dominate the office suite market with Microsoft Office. The company has diversified in recent years into the video game industry with the Xbox and its successor, the Xbox 360 as well as into the consumer electronics and digital services market with Zune, MSN and the Windows Phone OS. The ensuing rise of stock in the company’s 1986 initial public offering (IPO) made an estimated three billionaires and 12,000 millionaires…
.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 →