Home Tags Privacy About

Peter Daugaard Rasmussen

A personal blog on thoughts, ideas and solutions in the world of software development, programming, web development and software architecture.

← Newer Posts Page 11 of 41 Older Posts →

C# - How to add or remove headers using the HttpClient

You can set default headers on the HttpClient using the DefaultRequestHeaders property: _httpClient.DefaultRequestHeaders.Add("MyFantasticHeader" ,"MyFantasticValue"); var result = await _httpClient.GetAsync( »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, HttpClient 06 June 2022

C# - How to return a named tuple from a method

You are probably here because you have forgotten the syntax for returning a tuple from a method. To be honest that is also the reason why »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 June 2022

C# - How to create a named tuple or list of named tuples

There are two reasons you are on this page: 1) you forgot the syntax for named tuples 2) You have just learned about named tuples and »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 June 2022

C# - How to connect to a MSSQL database using a SqlConnection

You can use the SqlConnection class to connect to a MSSQL server. If we have a database called MyDb with a simple table called MyEntities: CREATE »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, MSSQL 01 June 2022

Google sheets - How to import a table from a website

You can easily fetch tables from websites in your Google sheets. To do this you can use the IMPORTTABLE function, which has the following signature: IMPORTHTML( »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Google sheets 29 May 2022

Ghost blog - How to disable portal scripts and membership features

I was quite annoyed back when the Ghost team introduced a lot of bloated scripts on what I believed should be the fastest and simplest blogging »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Ghostblog 26 May 2022

Web - An alternative to using image-set with background in CSS with a bit of Javascript and built-in lazy-load

I wanted to make my website score a little bit better on Google pagespeed and one area was the size of my images. I use background »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on HTML and CSS, Javascript 26 May 2022

C# Build error - An instance of analyzer <analyzer> cannot be created

I recently got the following error when trying to build a solution after installing a nuget package: > Warning CS8032 An instance of analyzer ProxyInterfaceSourceGenerator.ProxyInterfaceCodeGenerator »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 18 May 2022

Nsubstitute Error - NSubstitute.Exceptions.CouldNotSetReturnDueToNoLastCallException : Could not find a call to return from

If you see the following error: > NSubstitute.Exceptions.CouldNotSetReturnDueToNoLastCallException : Could not find a call to return from. You are likely trying to mock a method »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Testing, C# 17 May 2022

C# - How to mock or stub a class without an interface

Sometimes you come across a class that you need to stub or mock but it does not have an interface. The easiest way is of course »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Testing, C# 15 May 2022
← Newer Posts Page 11 of 41 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