Category Archives: .net

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

C# and Microsoft.ML. Removing words from sentence. Getting started with Machine Learning

Microsoft.ML is the NuGet package for ML.Net, Microsoft’s open-source Machine Learning framework. In this introduction I will create a stopword engine, capable of removing unwanted words from a sentence. I know that it is overkill to use machine learning to … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | Leave a 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

C# Working with Namespaces in XDocument and XML

XDocument is your old XML friend in C#, and it allows you to create or manipulate XML documents. To work with namespaces, you must use the XNamespace class. This is an imaginary XML document (a Google Merchant Feed formatted one) … 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

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

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 , , | 1 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