Tag Archives: .NET Core

Build .net core 6 projects with Azure Devops using yml files

DevOps is a complicated discipline, so when we as developers have to set up a build pipeline in Azure Devops we are sometimes in deep water. Thats why I made this yml template that I can copy from whenever I … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | 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 , , | 1 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

Run parallel tasks in batches using .NET Core, C# and Async coding

If you have several tasks that you need to run, but each task takes up resources, it can be a good idea to run the tasks in batches. There are a few tools out there, and one of them is … Continue reading

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

Write to SOLR from .NET Core

.NET Core supports the SOLR index through the SolrNet.Core NuGet packages. Here is how you update the index. STEP 1: THE NUGET PACKAGES You need the following NuGet packages: SolrNet.Core SolrNet.Microsoft.DependencyInjection STEP 2: CREATE A MODEL CLASS CONTAINING THE PROPERTIES … Continue reading

Advertisement

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

Handling “415 Unsupported Media Type” in .NET Core API

The default content type for .NET Core API’s is application/json. So if the content-type is left out, or another content type is used, you will get a “415 Unsupported Media Type”: This is for example true if you develop an … Continue reading

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

Simple C# MemoryCache implementation – Understand the SizeLimit property

The .NET Core IMemoryCache is probably the simplest cache there is, and it is very easy to use, once you get your head around the weird SizeLimit property. Especially when using the nice extension methods in this NuGet package: Microsoft.Extensions.Caching.Memory … Continue reading

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

Write to file from multiple threads async with C# and .NET Core

There are several patterns on how to allow multiple threads to write to the same file. the ReaderWriterLock class is invented for this purpose. Another classic is using semaphors and the lock statement to lock a shared resource. This article … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | 6 Comments

Sending JSON with .NET Core QueueClient.SendMessageAsync

You need to Base64 encode JSON serialized strings before adding them to a queue Continue reading

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

Using full Lucene Query Syntax in Azure Search

The Azure Cognitive Search is the search engine in Microsoft Azure. You can search using a simple queries (default) which is good at doing full text searches, or you can use full syntax which is a Lucene query syntax. The … Continue reading

Posted in .NET Core, Microsoft Azure | Tagged , , , , | 1 Comment