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 = "SbConnection")]SaySomething command, ILogger log) { log.LogInformation($"Incoming message: {command.Message}"); } As long as we have valid JSON, everything should "just work". However, when [Read More]

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 AutoMapper exists and what problems it was designed to solve. AutoMapper originated at the beginning of a large MVC application way back in the [Read More]

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 - do we need to coordinate these activities? Ultimately, it's a business decision about how to deal with the messiness [Read More]

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 all the scanning and dependency injection registration. You only need to declare Profile configuration. X DO NOT call CreateMap on each request [Read More]

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. While that is becoming less common as NoSQL options, as Azure CosmosDB supports them, and with the 4.0 release, MongoDB now supports multi-document [Read More]