We have an API that handles ~45k monthly requests that was, at times, responding strangely. I suspected it was related to the .NET Core service lifetimes. The symptoms in question were that out of the blue, the API response body had a status code of 409 with a message of invalid user-provided values, however, the […]
.NET Global Exception Handler to Return Problem Details For Your APIs
This article will focus on handling custom exceptions for flow control on .NET with a global exception handler and return a problem details object. Having said that. There are, for the most part, two schools of thought. One where it is OK to throw a (custom) exception to control flow. i.e. Throw a UserNotFoundException when […]
Configure CORS in .NET
We need to configure CORS in .NET (or really in any other language) when an application’s front-end and back-end are being served from different domains, aka origins. And more than likely, during development, both the front-end and back-end will be running from different ports on localhost.
.NET Core Options Pattern For Live Reload Settings
There are many great posts about implementing the Options Pattern .NET Core with IOptionsMonitor on the interwebs, but many fail to point out one “gotcha” when working with IOtionsMonitor to live reload settings.
Solved: GraphQL and Hot Chocolate Workshop issues with the latest versions of Hot Chocolate and .NET Top-Level Statements
I started working on the official “Getting started with GraphQL on ASP.NET Core and Hot Chocolate – Workshop” tutorial, but since the workshop is a bit outdated, it targets .NET 5 and an older version of Hot Chocolate. I am using the latest .NET 7 (at the time of this writing) and top-level statements. In […]
Add a React App to a NET Core MVC App
In this tutorial, we will go step by step on how to add a React App to a NET Core MVC App. Handling 404 pages and client routing. I am one to think that not everything I build has to be a Single Page Application (SPA). Recently I was building a project for a client, […]
Compile Sass Files in Visual Studio and Webpack
Sass is a very popular CSS pre-processors and the intent of the tutorial is to show you how to compile Sass files within Visual Studio using Webpack, this will include minification and autoprefixing for production. Sure, there are some plug-ins on the Visual Studio Marketplace, and is nice to just install a plug-in and forget […]
Getting Started with Vue.js in .NET Core using Visual Studio
You have heard a lot about Vue.js and how awesome it is, and now you want to use it with your next .NET Core app. Well, it is far easier than you might think. In this tutorial, besides getting started with Vue.js, we will cover the following: SASS compilation ES6+ JavaScript transpilation to ES5 with […]