Category Archives: .NET Core

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

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

HttpClient follow 302 redirects with .NET Core

The HttpClient in .NET Core will not automatically follow a 302 (or 301) redirect. You need to specify that you allow this. use the HttpClientHandler to do this: Now your code will follow up to 2 redirections. Please note that … Continue reading

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

Create a custom Azure Dashboard Tile Using an Azure Function and Markdown Format

The tiles on an Azure Dashboard will only display data from Azure itself. So if you have data from the outside, like a database, you need to make a few workarounds. Now, you cannot make your custom tile as pretty … Continue reading

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

C# Remove Duplicates from List with LINQ

C# LINQ do have a Distinct() method that works on simple types: For non-simple types, you have 2 options, but first lets make a non-simple type, a class: OPTION 1: IMPLEMENT AN EQUALITYCOMPARER The equalitycomparer is a class that is … Continue reading

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

Read and Write blob file from Microsoft Azure Storage with .NET Core

The documentation on the Azure Storage Blobs are a little fuzzy, as the NuGet packages and the approach have changed over time. The latest NuGet Package is now called: Azure.Storage.Blobs The concept of blob storages are the same though: You … Continue reading

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

Read and Write Azure Queue with .NET Core

The documentation around Azure Queues and .NET Core is a little fuzzy, as the approach have changed slightly over the last updates. Previously you had a shared Storage Account NuGet Package that gave access to Queues, Blob Storage and Table … Continue reading

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

Azure.Storage.Queues QueueMessage Deserialize JSON with .NET Core

The documentation around .NET QueueMessage is a little fuzzy so depending on the version of your NuGet libraries might differ in properties. This article uses the Azure.Storage.Queues, Version=12.7.0.0. If you, like me, have systems writing JSON messages to the queue, … Continue reading

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

C# Using Dapper as your SQL framework in .NET Core

Dapper is a easy to use object mapper for .NET and .NET Core, an it can be used a variety of ways. I use Dapper instead of Entity Framework because it makes my code less complex. BASICS OF DAPPER: THE … Continue reading

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

C# Remove specific Querystring parameters from URL

These 2 extension methods will remove specific query string parameters from an URL in a safe manner. METHOD #1: SPECIFY THE PARAMETERS THAT SHOULD GO (NEGATIVE LIST): Usage/Test cases: METHOD #2: SPECIFY THE PARAMETERS THAT MAY STAY (POSITIVE LIST): Usage/Test … Continue reading

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

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