Category Archives: General .NET

Issues related to general .NET and C# development

Host .net core 6.0 WebApplication as Kestrel Windows Service

If you create a .NET Core 6.0 Web Application as default, the application will run as an App Service just fine. But if you wish to host the application yourself, you can run the application as a Windows Service. This … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | Leave a comment

C# .NET Core API Versioning with Microsoft.AspNetCore.Mvc.Versioning

.NET Core allows you to control versions of your APIs. To do so you need the following NuGet package: Microsoft.AspNetCore.Mvc.Versioning But lets try to version our API. STEP 1: CREATE A CONTROLLER Notice how I in line 6 defines the … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , | Leave a comment

Read and Update Azure App Configuration settings with C#

Azure App Configuration is a nifty way of storing configuration settings in the cloud, and with the live reload feature you can change the config settings and they will automatically update in your app without a need for redeploy. But … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , , | Leave a comment

C# Deserialize JSON to dynamic ExpandoObject()

The Microsoft System.Text.Json.Serialization.JsonSerializer cannot (yet) convert JSON into dynamic objects. But good ole Newtonsoft.Json can. The conversion is simple too: After the conversion, you can work with the dynamic object as you wish: MORE TO READ: How to serialize and … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | Leave a comment

.NET 6.0 and Simple (minimal) Api’s: Create an Api without controllers

Have you always dreamt of skipping the controllers in your Web Api? Are you the lazy type? And have you always wanted to return data directly from your repositories? Feat not, .NET 6.0 to your rescue. The new “Minimal Api” … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | 1 Comment

C# DateTime to UNIX timestamps

Although the UNIX timestamp (also known as the EPOCH time or the POSIX time) probably does not make sense to you, it is still widely used. After all, who cares how many seconds have elapsed since Jan 1st 1970, right? … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | Leave a comment

Writing to Azure EventHub using EventHubBufferedProducerClient

The Azure Event Hub is a big data queue system capable of handling millions of events per second and packs nifty tricks in both the read and write end. I have written plenty of articles on how to read and … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , , | Leave a comment

C# Lists in Lists – Getting all inner values, or the unique inner values

Getting the inner value of a list inside a list can seem complicated in C#, but LINQ makes it easier. But first let’s make a list in a class, and then make a list of the class with the list … Continue reading

Posted in .net, c#, General .NET | Tagged , , | Leave a comment

Sitecore create custom Content Editor Warnings using Conditions and Rules

The Content Editor Warnings are these yellow boxes that hover over your content in the Content Editor in Sitecore: In the old days we would make them by hooking into the getContentEditorWarnings pipeline. Nowadays we use the Sitecore Rules engine. … Continue reading

Posted in c#, General .NET, Sitecore 5, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , , , , | Leave a comment