Home Tags Privacy About

All posts tagged with "C#"

C# (C-sharp) is a general-purpose programming language using strong typing, It was developed around 2000 by Microsoft and used on the .Net platform.

← Newer Posts Page 10 of 13 Older Posts →

C# - How to convert a list of tuples into a dictionary using the ToDictionary method

There is a built-in method in C# where you can create a dictionary from a list - it is called ToDictionary [https://docs.microsoft.com/en-us/ »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 July 2020

C# - How to easily create and start a new thread

It is quite easy to start a new thread in C#. All you need is to instantiate a new object of the type Thread and call »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Tasks and threads 30 May 2020

C# - how to inject, mock or stub DateTime for unit tests

In this post I will demonstrate how you can stub the DateTime [https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=netcore-3.1] struct in »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Testing 16 May 2020

What is the lock statement (monitor) in C#? and what you should look out for

In this post I will show how the lock statement in C# works and what you should look out for when using it. It is well »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Tasks and threads 25 April 2020

Asp.net websockets - sending messages back and forth between client and server

My previous post on websockets on how to stream messages to a client [https://peterdaugaardrasmussen.com/2019/01/20/how-to-use-websockets-with-asp-net-core-with-an-example/] has become quite popular. I felt »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, ASP.NET 14 March 2020

C# - How to make a list of tuples with named values

I found it hard to find an example online showing a simplistic way to create named value tuples in a list. Most of the examples I »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 22 February 2020

Why boolean names should be positive and not negative

This post may seem like sub optimization to some, however high readability of code makes code easier to understand and thereby change. In my opinion, great »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Java, Programming in general 08 February 2020

C# HttpClient - how to set content-type for a request

For some reason I can never remember how to make a POST or PUT request with a content-type other than JSON or XML. For JSON and »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on HttpClient, C# 01 February 2020

C# - How to read all lines in a file to an array or list

In C# it is quite convenient to read all files to an array. You can use the method ReadAllLines() [https://docs.microsoft.com/en-us/dotnet/api/ »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 January 2020

C# - Trim() String using a string instead of a single char

Today I found that C# does not have a built in method for trimming strings using another string. The built in method for trimming strings [https: »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 31 October 2019
← Newer Posts Page 10 of 13 Older Posts →
  • Rss
  • Twitter
  • LinkedIn
  • profile for Peter Rasmussen at Stack Overflow, Q&A for professional and enthusiast programmers
Peter Daugaard Rasmussen - developer, Consultant, Blogger © 2025 Privacy policy