Site Inspector
While moving some todos from one location to another I came across “Check Site Inspector” and thought, why not run it against this website right now – how hard can it be.
Not that hard it turns out.
Newtonsoft.Json vs System.Text.Json
System.Text.Json (STJ) is about twice as fast as Newtonsoft.Json while only consuming 50% as much memory. A legacy project might still be using Newtonsoft but chances are serialization isn’t a bottleneck so it’s probably not worth making the switch.
For new applications you’ll want to stick with STJ however. Only add the extra nuget if you really need one of the advanced Newtonsoft features (ex: Linq to Json, polymorphic serialization, circular reference handling).
Bootcamp: Home Automation
For our bootcamp we try to get everyone out of their comfort zone and, like many of our sessions, try to do something hands-on.
This year the topic of choice was “Home Automation”. The day was divided into two parts:
- Solder your own “smart socket” (and take it home with you!)
- Integrate it into one of the “smart houses” with Home Assistant
UnitTest: Check Security on your Controllers
Adding the [AllowAnonymous] or [Authorize("policy")] whenever a new Controller Action Method is added, it’s something that is easily forgotten.
… As I noticed when I was looking at some of our controllers 😵
Of course I have written this test many times before. These days it can be quickly re-created with AI but to avoid having to debug its code, here is the copy pasta version, with some possible variations.
.NET Testing Frameworks
Comparing .NET Testing Frameworks.
xunit/xunit: Community-focused unit testing tool
nunit/nunit: NUnit Framework
microsoft/testfx: MSTest framework and adapter
thomhurst/TUnit: A modern, fast and flexible .NET testing framework
ReduxJS/Toolkit: createSelector
reduxjs/reselect: Create memoized ‘selector’ functions
One of the Redux Style Guide “Strongly Recommended” rules is Keep State Minimal and Derive Additional Values:
Keep the actual data in the Redux store as minimal as possible, and derive additional values from that state as needed.
Another strongly recommended rule is Normalize Complex Nested/Relational State
Many applications need to cache complex data in the store. That data is often received in a nested form from an API, or has relations between different entities in the data (such as a blog that contains Users, Posts, and Comments).
Of course your components are interested in those derived values and in the nested data. Keeping those calculations and recombining the data efficient is where createSelector comes into play.
ReduxJS/Toolkit: createAsyncThunk
createAsyncThunk generates promise lifecycle action types, which you handle in the extraReducers of your slice.
import { createAsyncThunk } from "@reduxjs/toolkit";
export const fetchStuff = createAsyncThunk(
'resource/action',
async (params, thunkApi) => {
try {
const response = await fetch(`/api/resource/${params.id}`);
return await response.json();
} catch {
// Also possible to return a rejected Promise
return thunkApi.rejectWithValue("Well, that failed");
}
}
);
This dispatches the following actions (from the first “Type” argument):
resource/action/pending: display a spinner or something?resource/action/rejected: display an error message?resource/action/fulfilled: while the previous two could be considered optional, you definitely want to handle this one!
ReduxJS/Toolkit: createSlice and configureStore
The legacy Redux createStore could make a grown man cry, and probably has. createSlice and configureStore GREATLY simplifies this process while at the same time also significantly reducing the boilerplate – you can basically delete all your actions as they are now defined by the reducers!
createSlice: each top level object of your state is typically a sliceconfigureStore: abstracts away the horror that wascreateStore
ReduxJS/Toolkit: Immer
immerjs/immer: Create the next immutable state by mutating the current one
Immer is the solution the ReduxJS/Toolkit has adopted to enforce pure reducers: it allows you to write reducers while (almost) not having to think about immutability anymore!
Awards!? 🏆🥇
- React: Breakthrough of the year 2019
- JavaScript: Most impactful contribution 2019
ReduxJS/Toolkit
reduxjs/redux-toolkit: The official, opinionated, batteries-included toolset for efficient Redux development
This first post is context and can basically be ignored.
The remainder of the series are no-nonsense pretty detailed explanations on how to start using ReduxJS/Toolkit, assuming you’re basically already a “legacy” Redux expert but don’t want to read the gazillion pages that is the default documentation.
We’re 2025 and you start a new app with old, trusted and deprecated create-react-app, only to find out that using Redux is also, deprecated.
During previous migrations I took a long hard look at the ReduxJS/Toolkit documentation and I was like… Aint nobody got time for that!
For the last migration, I decided to give it go and well, I can already say with conviction, it is worth the time learning. Reduced boilerplate, batteries included and while the full documentation is still daunting, you can take it step by step.



![A comic book scene where a superhero (wearing a C# emblem) throws [Authorize] shields at rogue controller methods, cartoon villains named 'Anonymous Access' dodge them, bright bold colors, halftone patterns, comic panels with 'BOOM' and 'SECURED!' captions, playful and energetic, comic book art style](https://itenium.be/wp-content/uploads/2025/11/controller-security.png)








