Posts

What's in a Task?

Introduction Tasks in .NET have become ubiquitous: by now we all know that in order to make our apps and services more scalable (not necessarily performant, they are different concepts), we need to use them. A task is an operation that is designed to run in the background and which may or may not return a value. Tasks allow complex operations (I/O or CPU-bound) to be executed without blocking the main thread and are implemented by the Task  and  Task<T>  classes. These are actually monads  in mathematical and functional terminology, which means they have certain properties which I won't cover here. There are two ways by which we can call a method that is meant to be processed by another thread (one that returns  Task  or Task<T> , which inherits from  Task  but wraps a result): We use  await  to ask for the callee to be called by another thread and wait for its completion We omit  await  and have the callee processi...

SimpleStateMachine Index

These are the posts in the series: A Simple State Machine in .NET A Simple State Machine in .NET - Adding Code-based Implementation Simple State Machine Updates

ASP.NET Core Index

These are the posts in the series: ASP.NET Core API Versioning Getting Location and Weather from an IP Address Checking the Health of an ASP.NET Core Application Rate Limiting in ASP.NET Core Injecting Action Method Values from Configuration in ASP.NET Core OpenTelemetry with ASP.NET Core ASP.NET Core Middleware The Disposable Pattern in ASP.NET Core ASP.NET Core Distributed Tracing

C#/.NET Index

These are the posts in the series: Less Known LINQ Methods C# Records Implementing the Strategy Pattern with .NET Dependency Injection .NET 10 Validation Nullable and Required Types Working with Strings in .NET C# Magical Syntax .NET Collections .NET Metrics .NET Cancellation Tokens Service Discovery in .NET Retrieving Services from Dependency Injection in .NET The Evolution of .NET Dependency Resolution Named HttpClient Registrations What's in a Task?

EF Core Index

These are the posts in the series: Audit Trails in EF Core Text Querying with EF Core and SQL Server Using GUIDs with EF Core Value Generators in EF Core Optimising EF Core How to Seed Data to EF Core EF Core State Validation Modern Mapping with EF Core Table Inheritance with EF Core

Domain Events Index

These are the posts in the series: Domain Events with .NET Domain Events with .NET - New Features

Isolator Index

These are the posts in the series: Introducing Isolator - a framework for running isolated code for .NET Distributed Isolator Isolator with References Scanning Docker Support for Isolator

GitHub Index

These are the posts in the series: A GitHub Actions Pipeline to Generate OpenAPI Documentation

ASP.NET Core Multitenancy Index

These are the posts in the series: Multitenancy Techniques for EF Core Multitenancy Techniques for ASP.NET Core Multitenancy Techniques for the UI in ASP.NET Core Multitenancy Techniques for the Business Logic in ASP.NET Core (TBD)

Java Versus C# Index

These are the posts in the series: Java vs C# - Part 1 Java vs C# - Part 2 Java vs C# - Part 3 Java vs C# - Part 4 (TBD)