In the previous article, we discussed how to test the UmamiClient using xUnit and Moq. In this article, we will discuss how to test the UmamiBackgroundSender class. The UmamiBackgroundSender is a bit different to UmamiClient as it uses IHostedService to stay…
This is just a quick post to update everyone on the status of this blog. I started it a little over a month ago and decided to commit to at least one post a day for the first month. So far I've posted 52 times in 30 days, so I met and exceeded this goal (yay…
Now I have the Umami.Net package out there I of course want to ensure it all works as expected. To do this the best way is to somewhat comprehensively test all the methods and classes. This is where unit testing comes in. Note: This isn't a 'perfect approach'…
In the previous part I showed you how to set up self hosting for Seq using ASP.NET Core . Now that we have it set up it's time to use more of it's features to allow for more complete logging & tracing using our new Seq instance. Tracing Tracing is like…
In the previous part in this series, I set up the database for the comments system. In this post, I'll cover how saving the comments are managed client side and in ASP.NET Core. Add New Comment _CommentForm.cshtml This is a Razor partial view that contains the…
I use Mermaid.js to create the dope diagrams you see in a few posts. Like the one below. However something that annoyed me is that it wasn't reactive to switching themes (dark/light) and there seemed to be very poor information out there on achieving this.…
Seq is an application which lets you view and analyse logs. It's a great tool for debugging and monitoring your application. In this post I'll cover how I set up Seq to log my ASP.NET Core application. Can never have too many dashboards :) SeqDashboard Setting…
Now I have the Umami client; I need to package it up and make it available as a Nuget package. This is a pretty simple process but there are a few things to be aware of. Creating the Nuget Package Versioning I decided to copy Khalid and use the excellent…
In an earlier post I sketched out how a Tracking Client for Umami in C# could work. Well I've finally had a chance to test it extensively and improve it's operation (yes ANOTHER IHostedService). Quirks of the Umami API The Umami Tracking API is both very…
One of the key aspects of a blogging site like this is a comments system. So, I decided to build one. This is the first part of a series of posts on how to build a comments system. In this post, I will be setting up the database. Setting up the Database As…
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…