How to consume a REST API using Blazor

The RESTful service A couple of blog posts ago I wrote about how to design a REST API with ASP.NET Core and now I intend to show how to create a front end that can interface this service in order to create and remove products from the repository. To recap, the RESTful service was designed to […]

C# In-Memory File System

Unit testing code that reads or writes to the filesystem can be difficult. One thing that can help is an in-memory file system that lets you emulate the actual file system just for testing purposes. This morning I stumbled across a blog post by Jason Roberts, a five time Microsoft MVP, freelance developer, writer, and […]

Blazor – first impressions

What is Blazor? To quote the official Blazor homepage ”Blazor is a single-page web app framework built on .NET that runs in the browser with WebAssembly.” The natural follow-up question is then ”What is WebAssembly?”. From the official WebAssembly homepage we can read that ”WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based […]

C# Threading Gotchas

Introduction Threading and concurrency is a big topic and there are plenty of resources out there that covers the hows and whats related to starting new threads and avoiding locking up your UI and so on. I will not go into those details but rather try to focus on things that are good to know, […]

C# struct and class – when to use each?

Value types and Reference types In C# you have both Value types and Reference types. There are some fundamental differences between them that are important to understand. The most common value types are the simple ones, like int, bool, char, and long. But also enum and struct are value types. They are called value types […]

C# Protecting private collections from modification

Why do we want to hide data? One of the big advantages of object oriented programming is claimed to be possibilities to encapsulate data and hide internal implementation details. This enables us to make changes to our implementation without impacting our users and ensures our internal data does not get modified in ways that we […]