Are lock and Monitor the same in C#?

Working on some threading stuff I stumbled upon some discussions about lock and Monitor. Some say they are different and some say they are the same. I took few minutes of time to make some simple experiments with both of these. This blog post shows what C# compiler does with lock statement. As I had to use also Monitor class I added one example here how to use it instead of lock.

Read more

Running ASP.NET Core 2 applications on Windows 10 IoT Core

It has been problematic to run ASP.NET Core applications on Windows 10 IoT Core as it is not officially supported scenario yet and many components we are used with are not built with Windows 10 ARM in mind. Still it easy to run web applications on Windows 10 IoT Core using ASP.NET Core 2. There are few tricks developers should know when building web applications for Windows 10 IoT Core. This blog post is short guide about ASP.NET Core 2 on Windows 10 IoT Core

Read more

Boosting performance of Asus RT-N66U

Over time my home network has grown and years are changed also the habits of consuming media at home. When I bought Asus RT-N66U some years ago it was well performing home router. Now came the point when continuing the old way was not an option anymore as things were degraded a lot. Performance boost was needed and here is what I did to get my veteran router back on track.

Read more

Recognizing printed text on images using Azure Computer Vision API

Microsoft Cognitive Services offers us computer vision services to describe images and to detect printed or handwritten text. Text recognition provides interesting scenarios like cloud based OCR or providing automated translations for texts on images. This blog post focuses on recognizing printed text using Azure Computer Vision API.

Read more

Running ASP.NET Core applications on Windows Subsystem for Linux

Windows 10 has something called Windows Subsystem for Linux and this something enables us to run Linux applications on Windows 10 using Linux without need for Hyper-V or other virtual machines. When building multi-platform applications like my open-source TemperatureStation solution then having Linux right there for testing comes very handy. This blog post shows how to get Linux running on Windows, how to install .NET Core and how to run web applications on Linux.

Read more

Defensive database context for multi-tenant ASP.NET Core applications

In multi-tenant applications where tenants share same data store cross-tenant operations must be avoided. There are many ways how bugs like this can happen. Be it hard to debug threading issue or some other complex situation, it is better when application components are ready for this kind of situations and better fail instead of going to glory end with illegal operations. This blog post introduces defensive database context that throws exception when data from other tenants is about to be updated.

Read more

Implementing database per tenant strategy on ASP.NET Core

Let’s continue with multi-tenancy in ASP.NET Core web applications and focus on solutions where every tenant has its own database. It’s not only about database – there can be more services where every tenant has its own instance. It makes solution provided here easily extendable to also other services besides SQL Server or any other relational database.

Read more

ASP.NET Core: Building enum provider to convert C# enums to JavaScript

My previous post about ASP.NET Core and getting C# enums to JavaScript was primitive and used simple attribute on enums to detect ones we need in JavaScript. This blog post extends the idea and makes some generalizations to support also those enums that are located in the libraries we don’t control or on what we don’t want to apply attribute.

Read more