Skip to content

Instantly share code, notes, and snippets.

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.PixelFormats;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System;
using System.Collections.Concurrent;
using System.Threading;
public static class CancellationTokenExtensions
{
private static readonly ConcurrentDictionary<CancellationToken, string> _reasons = new();
private static readonly ConcurrentDictionary<CancellationToken, CancellationTokenSource> _sources = new();
// Method to create a CancellationToken with a reason
@DrkWzrd
DrkWzrd / AutomapperBug.cs
Created January 28, 2023 13:03
Automapper tries to read a nullable value without the nullable guard '?'
public abstract record PersonDto : BaseDto
{
protected PersonDto() { }
public string Firstname { get; init; }
public string Lastname { get; init; }
public string FullName => $"{Firstname} {Lastname}";