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) typically use: CQRS w/ MediatR Razor Pages models w/ AutoMapper Validation w/ Fluent Validation Conventional HTML w/ HtmlTags Database migrations w/ RoundhousE Integration testing w/ xUnit [Read More]

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]

Contoso University Examples with CQRS, MediatR, AutoMapper and more

I was a bit surprised yesterday to see Scott Hanselman's post on my Contoso University sample app. That application basically takes the traditional Contoso University sample applications (of which there have been many), and try to adapt it to how our "normal" ASP.NET applications are built. Mainly these applications serve as working examples for our own internal teams, so that when we spin up a new application, we have [Read More]

How Respawn Works

This post is mainly a reminder to myself when inevitably I forget what I was doing when designing Respawn. The general problem space is something I've covered quite a lot, but I haven't really walked through how Respawn works internally. The general problem is trying to find the correct order of deletion for tables when you have foreign key constraints. You can do something like: ALTER TABLE [Orders] NOCHECK CONSTRAINT [Read More]

Respawn 3.0 Released

Respawn, the intelligent database deleter, reached the 3.0 milestone today. In this release, Respawn now supports complex circular/cyclical relationships. When Respawn detects a cycle in the graph, it substitutes a separate deletion strategy by disabling/enabling foreign key constraints just for those tables affected. This release also adds support for Oracle, and drops support for SQL Server CE, bringing the supported databases to: SQL Server PostgreSQL MySQL/MariaDB [Read More]