no dogma blog
no dogma blog
Blog Posts
Podcast
Web API Lambda Course
Polly Course
Photos
Contact
Support this Site
About
RSS
Light
Dark
Automatic
C#
Create a Task and Start it Later
I usually want to run a task immediately, but there are times when I want to create a task, but not start it until later. This post will show you how to do defer execution of a task.
Mar 14, 2025
#
C#
,
.NET
,
Task
,
async
Killing a Worker Application from a BackgroundService
There are a few ways to kill a host application from a BackgroundService. In this post I’ll show what is probably the most correct way.
Feb 18, 2025
#
C#
,
.NET
,
BackgroundService
,
Worker
Making a Non Blocking Synchronous Call Inside a Background Service
This post shows you how to use a synchronous call in a background service without blocking the application or other background services.
Nov 7, 2024
#
C#
,
HostedService
,
BackgroundService
,
Synchronous
,
Asynchronous
Sharing Data Between BackgroundServices
It’s not immediately obvious how you can share data between background services. In this post, I show ways of achieving this.
Oct 25, 2024
#
C#
,
BackgroundService
,
HostedService
Getting the Running Operating System in C#
It’s not obvious how to get the operating system your C# application is running, but it can be done with a single line of code.
Sep 30, 2024
#
C#
,
.NET
,
Operating System
,
Version
Using Postgres with C#
It’s not a problem to use Postgres C# and .NET. You can also use Entity Framework.
Jun 6, 2024
#
Postgres
,
C#
,
Docker
Getting the Method Name from a Task in C#
Getting the name of a method from a task is not trivial, but this post will show you how to do it and includes an extension method for you to use.
Mar 28, 2024
#
Task
,
C#
Repository File Statistics
It can be useful to see what types of files are in a repository and how many of each type there are, how many comments, blank lines, etc. This post shows how to do this with local repositories.
Feb 6, 2024
#
C#
,
Git
,
Repository
Throw ThrowIfCancellationRequested in a Method that Returns a Value when Using a Cancellation Token
When sending a cancellation request to a method that returns a value, you must return a value or throw an exception. Here is how to throw the exception.
Jan 3, 2024
#
C#
,
dotNet
,
async
,
CancellationToken
Simple Cancellation Token Example
Here is an example of using a cancellation token to stop the execution of a method.
Dec 28, 2023
#
C#
,
dotNet
,
async
,
CancellationToken
»
Cite
×