MediatR MediatR 8.0 Released This release brings some (minor) breaking changes to the public API. First, we added a non-generic overload to Send on IMediator: public interface IMediator { Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default); + Task<object> Send(object request, CancellationToken cancellationToken = default)
Docker User Secrets in Docker-based .NET Core Worker Applications As part of the recent Message Endpoints in Azure series, I wanted to check out the new .NET Core 3.0 Worker templates to see how the templates have improved the situation (actually, a lot), but there are still some things missing from the Worker SDK versus the Web SDK.
OSS Contoso University Vertical Slice App Updated to ASP.NET Core 3.0 To keep a running example of "how we do web apps", I've updated my Contoso University example app to ASP.NET Core 3.0. This sample app is just a re-jiggering of Microsoft's Contoso University Razor Pages sample app . It shows how we (Headspring)
MongoDB Document-Level Optimistic Concurrency in MongoDB I've had a number of projects now that have used MongoDB, and each time, I've needed to dig deep into the transaction support. But in addition to transaction support, I needed to understand the concurrency and locking models of Mongo. Unlike many other NoSQL databases, Mongo
Azure Building Messaging Endpoints in Azure: Functions Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps In our last post, we looked at deploying message endpoints in containers, eventually out to Azure Container Instances. While fairly straightforward, this approach is fairly close to Infrastructure-as-a-Service. I can
Azure Building Messaging Endpoints in Azure: Container Instances Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps In the last post, we looked at Azure WebJobs as a means of deploying messaging endpoints. And while that may work for smaller loads and simpler systems, as the number
Azure Building Messaging Endpoints in Azure: WebJobs Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps In the last post, I looked at creating a generic host endpoint that many of the deployed versions in Azure can share. By using a hosted service, we can then
Testing Integration Testing with xUnit A few years back, I had given up on xUnit in favor of Fixie because of the flexibility that Fixie provides. The xUnit project is highly opinionated, and geared strictly towards unit tests. It's great for that. A broader testing strategy includes much more than just unit tests.
AutoMapper AutoMapper LINQ Support Deep Dive My favorite feature of AutoMapper is its LINQ support. If you're using AutoMapper, and not using its queryable extensions, you're missing out! Normal AutoMapper usage is something like: var dest = _mapper.Map<Dest>(source); Which would be equivalent to: var dest = new Dest { Thing
AutoMapper AutoMapper 9.0 Released As with the other major releases of AutoMapper, this one introduces breaking API changes with relatively few other additions. The major breaking changes (see upgrade guide for details) include: * Removing the static API * Removing "dynamic" maps (automatically created maps) * Fix on IMappingAction to include a ResolutionContext parameter The
Messaging Immutability in Message Types In just about every custom I've worked with, eventually the topic of immutability in messages comes up. Messages are immutable in concept, that is, we shouldn't change them (except in the case of document messages). Since messages are generally immutable in concept, why not make them
Azure Building Messaging Endpoints in Azure: A Generic Host Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps In the last post, we looked at the many ways we can consume messages in Azure as a message endpoint. Unfortunately, there's not an easy answer. We don&
Microservices Message Naming Conventions One of the first design decisions teams starting with messaging are presented with are - what the heck do we name these things? When building out request/response types for typical API/web applications, I name the responses usually after the resource they represent, or the route, or controller/action.
Azure Building Messaging Endpoints in Azure - Evaluating the Landscape Posts in this series: * Evaluating the Landscape * A Generic Host * Azure WebJobs * Azure Container Instances * Azure Functions * Azure Container Apps When looking at moving traditional on-prem solutions to the cloud, I try as much as possible to avoid any kind of lift-and-shift strategy and instead leverage as many platform-as-a-service (PaaS)
Microservices Composite UIs for Microservices: Vertical Slice APIs This is a recent follow-up pattern to my series on Composite UIs in Microservices, which explores various strategies for composing at the edges. Other posts in this series: * A primer * Composition options * Client composition * Server composition * Data composition * Vertical Slice APIs When looking at a client-side composition, the next logical
MediatR MediatR 7.0.0 Released Release notes: * MediatR 7.0.0 * MediatR.Extensions.Microsoft.DependencyInjection 7.0.0 It's a major release bump because of a breaking change in the API of the post-processor. Enjoy!
AutoMapper AutoMapper 8.1.0 Released Today we released AutoMapper 8.1.0: * Upgrade Guide for 8.0 * Release Notes AutoMapper 8.1 adds a major new feature - attribute-based maps. Attribute maps let you easily declare maps on destination types when you have straightforward scenarios. Instead of: public class OrderProfile { public OrderProfile() { CreateMap<Order,
MediatR Sharing Context in MediatR Pipelines MediatR, a small library that implements the Mediator pattern, helps simplify scenarios when you want a simple in-memory request/response and notification implementation. Once you adopt its pattern, you'll often find many other related patterns start to show up - decorators, chains of responsibility, pattern matching, and more.
OSS The Curious Case of the JSON BOM Recently, I was testing some interop with Azure Service Bus, which has a rather useful feature when used with Azure Functions in that you can directly bind JSON to an custom type, to do something like: [FunctionName("SaySomething")] public static void Run([ServiceBusTrigger("Endpoints.SaySomething", Connection
AutoMapper AutoMapper's Design Philosophy While a lot of people use AutoMapper, and love it, I meet just as many people that hate it. When I hear their stories, it becomes clear to me that it's not that AutoMapper was "abused" per se, but that it was used without understanding why
Microservices Life Beyond Distributed Transactions: An Apostate's Implementation - Conclusion Posts in this series: * A Primer * Document Coordination * Document Example * Dispatching Example * Failures and Retries * Failure Recovery * Sagas * Relational Resources * Conclusion We started out with a common, but nearly always overlooked problem: how do we reliably coordinate activities between different transactional resources? The question we need to ask first is
AutoMapper AutoMapper Usage Guidelines Configuration √ DO initialize AutoMapper once with Mapper.Initialize at AppDomain startup in legacy ASP.NET AutoMapper's static initialization is designed to build configuration once, and cache it. √ DO use the AutoMapper.Extensions.Microsoft.DependencyInjection package in ASP.NET Core with services.AddAutoMapper(assembly[]) The extensions package will perform
Microservices Life Beyond Distributed Transactions: An Apostate's Implementation - Relational Resources Posts in this series: * A Primer * Document Coordination * Document Example * Dispatching Example * Failures and Retries * Failure Recovery * Sagas * Relational Resources * Conclusion Sample code from this series So far in this series we've mainly concerned ourselves with a single resource that can't support distributed (or multi-entity) transactions.
AutoMapper AutoMapper 8.0.0 Released Today we released AutoMapper 8.0.0: * Upgrade Guide * Release Notes AutoMapper 8.0 brings some breaking API changes, meant to simplify our configuration options which have grown quite a bit over time and remove some confusion about what configuration options were effectively equivalent. The upgrade guide walks through the
Microservices Life Beyond Distributed Transactions: An Apostate's Implementation - Sagas Posts in this series: * A Primer * Document Coordination * Document Example * Dispatching Example * Failures and Retries * Failure Recovery * Sagas * Relational Resources * Conclusion Sample code from this series So far in this series, we've looked at the ins and outs of moving beyond distributed transactions using persisted messages as a