🍪 Privacy & Transparency

We and our partners use cookies to Store and/or access information on a device. We and our partners use data for Personalised ads and content, ad and content measurement, audience insights and product development. An example of data being processed may be a unique identifier stored in a cookie. Some of our partners may process your data as a part of their legitimate business interest without asking for consent. To view the purposes they believe they have legitimate interest for, or to object to this data processing use the vendor list link below. The consent submitted will only be used for data processing originating from this website. If you would like to change your settings or withdraw consent at any time, the link to do so is in our privacy policy accessible from our home page..

Vendor List | Privacy Policy
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 2 of 12 Older Posts →

C# - How to subtract time from a DateTime or DateTimeOffset

You are likely looking for one of these two examples (using hours): var dateTimeMinusOneHour = DateTime.Now.Subtract(TimeSpan.FromHours(1)); var dateTimeMinusOneHour = DateTime.Now.AddHours(-1) »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 06 September 2022

C# ASP.NET - How to download a file from an endpoint, with PDF, JPG and CSV example

I have previously written a post on how to return HTML from an ASP.NET controller endpoint. In this post I will take a more general »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, ASP.NET 06 September 2022

C# - How to make HTTP / REST calls using the HttpClient

C# has great built-in support for making HTTP requests using the HttpClient. Using this client you can Put, Post, Get, Delete and much more using your »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, HttpClient 29 August 2022

C# Dapper - How to use transactions with Dapper

Dapper is a micro ORM or a simple object mapper and it integrates smoothly with C# and its SqlConnection. The same applies to Dapper and transactions »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Dapper 28 August 2022

C# Dapper - How to call a stored procedure with a parameter

This post shows you how to call a stored procedure with a parameter using Dapper. If we have the following table with an Id (int) and »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Dapper, MSSQL 28 August 2022

C# HttpClient - How to send a Delete request with or without a body

Using the HttpRequestMessage together with the HttpClient you can easily send a HTTP Delete request in C#. Below we have a delete endpoint on https://localhost: »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, HttpClient 27 August 2022

ASP.NET - How to make a controller endpoint for a HTTP Delete request

Like with HttpGet HttpPut or HttpPost attributes there is a respective attribute for the HTTP Delete Method - HttpDelete. You can add this attribute to get »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, ASP.NET 25 August 2022

C# - How to return a completed Task with or without a result

When using tasks you at some point come across having to return a Task without actually having a Task to return. The usual case is in »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Tasks and threads 24 August 2022

C# - The difference between System.Tuple and System.ValueTuple

Prior to C# 7, the only type of tuple was the System.Tuple class. This type of Tuple is an immutable class (reference type) and a »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 02 August 2022

C# - CS8803 Top-level statements must precede namespace and type declarations

Earlier I was putting some code together for an example. I got the following error (Top-level statements must precede namespace and type declarations): Error CS8803 Top-level »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 01 August 2022
← Newer Posts Page 2 of 12 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 © 2023 Privacy policy