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 โTag: .NET
Dependency Injection in .NET: Service Lifetimes
Using the wrong DI lifetime is the #1 cause of concurrency bugs in ASP.NET Core. We revisit Singleton, Scoped, and Transient with a focus on thread safety. The Three Lifetimes Lifetime Created… Thread Safety Transient Every time requested Safe (Instance per usage) Scoped Once per HTTP Request Safe (Single thread per request) Singleton Once per […]
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 โC# 9.0 Top-Level Programs: Reducing Boilerplate
C# has always been criticized for the “Hello World” ceremony. You needed a namespace, a class, and a static Main method just to print one line. C# 9 Top-Level Programs remove this requirement, bringing C# closer to scripting languages like Python for simple tasks and microservices. The New Entry Point Behind the Scenes The compiler […]
Read more โEntity Framework Core 5.0: Many-to-Many and More
EF Core 5.0 brings the feature everyone has been asking for: Many-to-Many relationships without a mapped join entity. It also introduces Split Queries to fix the “Cartesian Explosion” problem in complex joins. Many-to-Many You can now define navigation properties on both sides, and EF Core handles the middle table. Split Queries Instead of one giant […]
Read more โSource Generators in C# 9: Compile-Time Code Generation
Source Generators allow you to inspect code during compilation and generate new C# files on the fly. Unlike Reflection (runtime slow) or IL Weaving (complex), Source Generators are fast, debuggable, and integrated into Roslyn. How it Works Example: INotifyPropertyChanged Automate the boilerplate of MVVM. Key Takeaways Generators can **add** code, but cannot **modify** existing code. […]
Read more โ