Ali Hamza Ansari

Ali Hamza Ansari

Meet Ali, a talented .NET developer from Pakistan. Besides blogging, Ali works for a range of international customers doing everything from C# to Azure.

51 posts
Implementing strongly-typed IDs in .NET for safer domain models

As developers, we know that user requests can be unpredictable. When they request data, it is either successfully returned or not found. However, a "not found" result usually happens in two ways. First, the user might request a record, such as a basketball player, by passing an ID ...

New in .NET 10 and C# 14: Multi-Tenant Rate Limiting

.NET 10 is officially out, along with C# 14. Microsoft has released .NET 10 as Long-Term Support (LTS) as a successor to .NET 8. Like every version, it is not just an update but brings something new to the table. In this series, we will explore which aspects of software ...

New in .NET 10 and C# 14: Fast Model Validation for APIs

.NET 10 is officially out, along with C# 14. Microsoft has released .NET 10 as Long-Term Support (LTS) as a successor to .NET 8. Like every version, it is not just an update but brings something new to the table. In this series, we will explore which aspects of software ...

New in .NET 10 and C# 14: Enhancements in APIs Request/Response Pipeline

.NET 10 is officially out, along with C# 14. Microsoft has released .NET 10 as Long-Term Support (LTS) as a successor to .NET 8. Like every version, it is not just an update but brings something new to the table. In this series, we will explore which aspects of software ...

New in .NET 10 and C# 14: EF Core 10's Faster Production Queries

.NET 10 is officially out, along with C# 14. Microsoft has released .NET 10 as Long-Term Support (LTS) as a successor to .NET 8. Like every version, it is not just an update but brings something new to the table. In this series, we will explore which aspects of software ...

New in .NET 10 and C# 14: Optimizations in log aggregation jobs

.NET 10 is officially out, along with C# 14. Microsoft has released .NET 10 as Long-Term Support (LTS) as a successor to .NET 8. Like every version, it is not just an update but brings something new to the table. In this series, we will explore which aspects of software ...

Using Strategy Pattern with Dependency Injection in ASP.NET Core

Selection logic is a prominent part of many applications. Whether you add a simple environment toggle, a UI mode decision, or apply a discount, you have to rely on user input. Sometimes, simply using an intuitive if-else or a switch case can work. However, when conditions are growing or a ...

Mastering owned entities in EF Core: Cleaner complex types

Not all data in your application should live as a standalone table with its own ID and lifecycle. Sometimes you need a tightly coupled dependent object that exists alongside its parent, like a movie's budget, a survey's questions, or a customer's address. If you ...

Building Read Models with EF Core Projections

You can't really argue against the importance of performance in any application. Even if the system is not time-critical, efficient and time-saving operations are cornerstones of the system. Data fetching is the primary step for improving the performance of most applications. If you use Entity Framework Core (EF ...