Dealing with access tokens in dotnet
Photo by Ashwini Chaudhary Introduction When working with http APIs you'll sooner or later run into access tokens. I will not go into any depth of the whys and the hows but let's do a quick breakdown....
View ArticleSorting (really) large files with C#
The problem Imagine the following (completely made up ofc, no one would ever use CSV files of this size, right?) scenario: Hello Josef! I need to get this CSV file sorted in ascending order ASAP before...
View ArticleSorting large CSV files by column using C#
Photo by Maksym Kaharlytskyi This is a follow up to my previous post about sorting (really) large files using c#. The problem We have the following CSV file:...
View ArticleCSVHelper - Read column value into a List property
Photo by Mika Baumeister When working with C# and CSV files, I always use CSVHelper. It's a small library for reading and writing CSV files. Extremely fast, flexible, and easy to use. I couldn't agree...
View ArticleC# - Throttle outgoing http requests - Concurrent
Photo by Denys Nevozhai Introduction This is the first part in a series I'm planning to write about how to consume http apis with rate limiting in mind. This post will focus on how to handle rate...
View ArticleSorting (really) large files with C#
The problem Imagine the following (completely made up ofc, no one would ever use CSV files of this size, right?) scenario: Hello Josef! I need to get this CSV file sorted in ascending order ASAP before...
View ArticleSorting large CSV files by column using C#
Photo by Maksym Kaharlytskyi This is a follow up to my previous post about sorting (really) large files using c#. The problem We have the following CSV file:...
View ArticleJOS.Configuration - Convenient methods for configuration in dotnet core
Photo by Manik Roy I want my configuration objects to be plain pocos. I don't want to depend on the IOptions<ExampleOptions> pattern in my code, I want to inject the poco (without the IOptions...
View ArticleTidy up your HttpClient usage
Photo by CDC Introduction This is just a quick tip for anyone using HttpClient and wants to avoid some of the boilerplate (error handling, logging etc). Usually my implementations looks something like...
View ArticleJOS.Configuration - Convenient methods for configuration in dotnet core
Photo by Manik Roy I want my configuration objects to be plain pocos. I don't want to depend on the IOptions<ExampleOptions> pattern in my code, I want to inject the poco (without the IOptions...
View ArticleTidy up your HttpClient usage
Photo by CDC Introduction This is just a quick tip for anyone using HttpClient and wants to avoid some of the boilerplate (error handling, logging etc). Usually my implementations looks something like...
View ArticleJOS.Configuration - Convenient methods for configuration in dotnet core
Photo by Manik Roy I want my configuration objects to be plain pocos. I don't want to depend on the IOptions<ExampleOptions> pattern in my code, I want to inject the poco (without the IOptions...
View ArticleSorting large CSV files by multiple columns using C#
Photo by Alex Block This is a follow up to my previous post about sorting large files by column using c#. The problem We have the following CSV file: FirstName,LastName,Album,Attendance,City...
View ArticleMongoDB - Missing discriminator array when doing upserts with UpdateOneModel
The problem Given the following two classes: [BsonDiscriminator(RootClass = true)] [BsonKnownTypes(typeof(MongoDbSomeModel))] [BsonIgnoreExtraElements] public class MongoDbBaseModel { [BsonId] public...
View ArticleSorting large CSV files by multiple columns using C#
Photo by Alex Block This is a follow up to my previous post about sorting large files by column using c#. The problem We have the following CSV file: FirstName,LastName,Album,Attendance,City...
View ArticleMongoDB - Missing discriminator array when doing upserts with UpdateOneModel
The problem Given the following two classes: [BsonDiscriminator(RootClass = true)] [BsonKnownTypes(typeof(MongoDbSomeModel))] [BsonIgnoreExtraElements] public class MongoDbBaseModel { [BsonId] public...
View ArticleSorting large CSV files by multiple columns using C#
Photo by Alex Block This is a follow up to my previous post about sorting large files by column using c#. The problem We have the following CSV file: FirstName,LastName,Album,Attendance,City...
View ArticleBeware of potential XSS injections when using ProblemDetails in ASP.NET Core
Photo by Elisa Ventur Introduction An old colleague of mine (Nils Stjernstrid) wrote to me a couple of weeks ago and told me that he wanted me to be aware of a potential problem with the default...
View ArticleEfficient file uploads with dotnet
Introduction Recently I needed to solve the following problem at work We need to upload a lot of large files to a third party storage provider, it needs to be as efficient as possible. This problem is...
View ArticleBeware of potential XSS injections when using ProblemDetails in ASP.NET Core
Photo by Elisa Ventur Introduction An old colleague of mine (Nils Stjernstrid) wrote to me a couple of weeks ago and told me that he wanted me to be aware of a potential problem with the default...
View Article