How to fix the order of commits in GitHub Pull Requests
In this post I show how to ensure your commits in a GitHub pull request (PR) are in the order you expect for reviewers - i.e. the logical order of the commits to a branch, not the date order. Warning:...
View ArticleDon't replace your View Components with Razor Components
In this post I take a brief look at Razor Components, and whether you should consider using them instead of View Components. I'm sure you can guess my conclusion from the title, but I admit that's...
View ArticleReplacing AJAX calls in Razor Pages with Razor Components and Blazor
In a recent post I looked at whether you should consider using Razor Components in places where you would previously have used View Components. The answer was an emphatic no, but that doesn't mean you...
View ArticleAccessing route values in endpoint middleware in ASP.NET Core 3.0
In my recent series about upgrading to ASP.NET Core 3.0, I described how the new endpoint routing system can be combined with terminal middleware (i.e. middleware that generates a response). In that...
View Article5 ways to set the URLs for an ASP.NET Core app
By default, ASP.NET Core apps listen on the following URLs: http://localhost:5000 https://localhost:5001 In this post I show 5 different ways to change which URLs your app listens on. There are...
View ArticleHow to automatically choose a free port in ASP.NET Core 3.0
This post is in response to a discussion I had with a friend recently who was trying out .NET Core. Unfortunately, when they attempted to start their new application they received the following...
View ArticleAdding simple email address obfuscation for your blog like Cloudflare Scrape...
In this post I show a simple way to obfuscate email addresses to make it harder for bots to scrape them from your site. It uses a similar approach as Cloudflare Scrape Shield. It's important to note...
View ArticlePreventing mass assignment or over posting with Razor Pages in ASP.NET Core
Mass assignment, also known as over-posting, is an attack used on websites that use model-binding. It is used to set values on the server that a developer did not expect to be set. This is a well...
View ArticleUsing jQuery and Bootstrap from a CDN with fallback scripts in ASP.NET Core 3.0
In this post, I show how to use the Link Tag Helper and Script Tag Helper in Razor with the asp-fallback attribute to serve files from a Content Delivery Network (CDN), falling back to local scripts...
View ArticleExtending the shutdown timeout setting to ensure graceful IHostedService...
I was seeing an issue recently where our application wasn't running the StopAsync method in our IHostedService implementations when the app was shutting down. It turns out that this was due to some...
View ArticleHandling Web API Exceptions with ProblemDetails middleware
In this short post I describe a handy error-handling middleware, created by Kristian Hellang, that is used to return ProblemDetails results when an exception occurs. ProblemDetails and the...
View ArticleStrongly-typed ID update 0.2.1: Using strongly-typed entity IDs to avoid...
This is the sixth post in the series: Using strongly-typed entity IDs to avoid primitive obsession. Part 1 - An introduction to strongly-typed entity IDs Part 2 - Adding JSON converters to strongly...
View ArticleCustomising the ASP.NET Core default UI without editing the PageModels
ASP.NET Core Identity includes a default UI as a Razor library that enables you to quickly add users to an application, without having to build all the UI yourself. The downside is that if you want to...
View ArticleSetting global authorization policies using the DefaultPolicy and the...
ASP.NET Core has an extensive authorization system that you can use to create complex authorization policies. In this post, I look at the various ways you can apply these policies to large sections of...
View ArticleAdding host filtering to Kestrel in ASP.NET Core
Host filtering, restricting the hostnames that your app responds to, is recommended whenever you're running in production for security reasons. In this post, I describe how to add host filtering to an...
View ArticleGetting started with ASP.NET Core
The Manning Early Access Program (MEAP) has started for the second edition of my book ASP.NET Core in Action, Second Edition. This post gives you a sample of what you can find in the book. If you like...
View ArticleVisualizing endpoints using the DOT language: Visualizing ASP.NET Core 3.0...
This is the first post in the series: Visualizing ASP.NET Core 3.0 endpoints using GraphvizOnline. Part 1 - Visualizing endpoints using the DOT language (this post) Part 2 - Adding an endpoint graph...
View ArticleAdding an endpoint graph to your ASP.NET Core application: Visualizing...
This is the second post in the series: Visualizing ASP.NET Core 3.0 endpoints using GraphvizOnline. Part 1 - Visualizing endpoints using the DOT language Part 2 - Adding an endpoint graph to your...
View ArticleCreating a custom DfaGraphWriter using ImpromptuInterface for easier...
This is the third post in the series: Visualizing ASP.NET Core 3.0 endpoints using GraphvizOnline. Part 1 - Visualizing endpoints using the DOT language Part 2 - Adding an endpoint graph to your...
View ArticleCreating a custom endpoint visualization graph: Visualizing ASP.NET Core 3.0...
This is the fourth post in the series: Visualizing ASP.NET Core 3.0 endpoints using GraphvizOnline. Part 1 - Visualizing endpoints using the DOT language Part 2 - Adding an endpoint graph to your...
View Article