This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Flags] | |
#pragma warning disable format, RCS1154, RCS1037 | |
public enum EnumFlag | |
{ | |
Flag1 = 0b0000_0000_0000_0001, | |
Flag2 = 0b0000_0000_0000_0010 | |
} | |
#pragma warning restore format, RCS1154, RCS1037 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var cs1= new CancellationTokenSource (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exist artifacts rmdir artifacts /s /q | |
dotnet publish -c Release -r win-x64 --output ./artifacts --self-contained true -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:CopyOutputSymbolsToPublishDirectory=false -p:EnableCompressionInSingleFile=true -p:DebugSymbols=false -p:DebugType=None | |
if exist artifacts.7z del artifacts.7z | |
7z a artifacts artifacts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("Anonymous pattern matching"); | |
var text = "Hello"; | |
var person = new PersonRecord("Andreas", "Klapperich", 11); | |
var output = new { Text = text, Person = person } switch | |
{ | |
{ Text: { }, Person: null } content => $"{content.Text} Unknown", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (var year = 20; year < 40; year++) | |
if (DateTime.TryParseExact($"{year:00}0101", "yyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var date)) | |
Console.WriteLine($"[{year:00} = {date.Year:0000}] {year:00}0101 = {date:yyyy.MM.dd}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Newtonsoft.Json; | |
using static System.Console; | |
public class Program | |
{ | |
public class TestClass | |
{ | |
public DateTime TimeStamp{get;set;}= DateTime.MinValue; | |
public DayOfWeek DayOfWeek {get;set;}= DayOfWeek.Monday; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
foreach(var calibrationPackageCount in Enumerable.Range(0, 10)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
// für Heinz | |
// hiermit wird nur ein Object erstellt und der Wert ist empty | |
var a = new Guid(); | |
Console.Write($"a = {a}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TestSonarQube | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(Test(true)); | |
Console.WriteLine(Test(false)); | |
Console.WriteLine(Test("Hello World")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace NiceExceptionName | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World!"); | |
M(null); |
NewerOlder