In this post I'll be starting adding Unit Testing for this site. This won't be a full tutorial on Unit Testing, but rather a series of posts on how I'm adding Unit Testing to this site. In this post I test some services by mocking DbContext; this is to avoid…
In previous articles, we have discussed the importance of translation in the context of web applications. We have also explored the use of the EasyNMT library to perform translations in an ASP.NET Core application. In this post I'll cover how I added a…
In the previous parts of this series we introduced the concept of full text searching and how it can be used to search for text within a database. In this part we will introduce how to use OpenSearch with ASP.NET Core. Previous parts: Full Text Searching with…
In the previous parts of this series we introduced the concept of full text searching and how it can be used to search for text within a database. In this part we will introduce OpenSearch, a powerful search engine that can be used to search for text. In this…
In our previous post here we discussed how we can use EasyNMT to translate our .md files into different languages. We also discussed how we can surface this functionality to the user by adding a dropdown to the markdown editor. In this post we'll discuss how…
So for a while now I've used EasyNMT to translate my .md files into different languages here. I've wanted to 'surface' this so you can all have a play with it too. See the second part of this series here. The eagle eyed amongst you will have noticed that I've…
This is a dumb little article because I was a bit confused about how to ensure that my IHostedService was a single instance. I thought it was a bit more complicated than it actually was. So I thought I'd write a little article about it. Just in case anyone…
When adding the search box in the prior article, we left out a critical security feature: XSRF protection. This article will cover how to add XSRF protection to the search box. What is XSRF? XSRF stands for Cross-Site Request Forgery. It is a type of attack…
In the last article I showed you how to set up a full text search using the built in full text search capabilities of Postgres. While I exposed a search api I didn't have a way to actually use it so...it was a bit of a tease. In this article I'll show you how…
Searching for content is a critical part of any content heavy website. It enhances discoverability and user experience. In this post I'll cover how I added full text searching for this site Next parts in this series: Search Box with Postgres Introduction to…
Now that I have this blog running using Entity Framework I can add new posts and languages easily. I just add a new markdown file to the project and check it in. The GitHub action triggers and the site is updated. In this post I'll cover a couple of small…
In a previous post we added a client for fetching Umami analytics data. In this post we will add a client for sending tracking data to Umami from a C# application. Umami is a lightweight analytics service that can be self-hosted. It is a great alternative to…
One thing I thought it would be fun to add is a way to look at the markdown for the articles on the site with a live rendering of the markdown. This is a simple markdown editor that uses SimpleMDE and a server side rendering of the markdown using the markkdig…
See parts 1 and 2 and 3 and 4 for the previous steps. Introduction In previous parts we covered how to set up the database, how our controllers and views are structured, how our services worked, and how to seed the database with some initial data. In this part…
See parts 1 and 2 and 3 for the previous steps. Introduction In previous parts we covered how to set up the database, how our controllers and views are structured, and how our services worked. In this part we'll cover details on how to seed the database with…
In any web application it's important to handle errors gracefully. This is especially true in a production environment where you want to provide a good user experience and not expose any sensitive information. In this article we'll look at how to handle errors…
You can find all the source code for the blog posts on GitHub Parts 1 & 2 of the series on adding Entity Framework to a .NET Core project. Part 1 can be found here. Part 2 can be found here. Introduction In the previous parts we set up the database and the…
You can find all the source code for the blog posts on GitHub Part 2 of the series on adding Entity Framework to a .NET Core project. Part 1 can be found here. Introduction In the previous post, we set up the database and the context for our blog posts. In…
Imtroduction In this post, I will show you how to create a C# client for the Umami reporting API. This is a simple example that demonstrates how to authenticate with the API and retrieve data from it. You can find all the source code for this on my GitHub…
ImageSharp is a powerful image processing library that allows you to manipulate images in a variety of ways. ImageSharp.Web is an extension of ImageSharp that provides additional functionality for working with images in ASP.NET Core applications. In this…