var logConfig = new LoggerConfiguration()
.MinimumLevel.Verbose()
.Enrich.FromLogContext()
.WriteTo.ColoredConsole(LogEventLevel.Error, "{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3} {SourceContext}: {Message}{NewLine}")
.WriteTo.Logger(
c => c.WriteTo.ColoredConsole(LogEventLevel.Information, "{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3} {SourceContext}: {Message}{NewLine}")
.Filter.ByIncludingOnly("SourceContext = 'Microsoft.Hosting.Lifetime'"))
This file contains 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
// See https://aka.ms/new-console-template for more information | |
using System.Globalization; | |
using System.Runtime.CompilerServices; | |
ShowCulture("start"); | |
await SetFrenchAsync(); | |
ShowCulture("end"); | |
async Task SetFrenchAsync() |
This file contains 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
public class RepostOnMastodon | |
{ | |
private readonly AuthenticationClient client; | |
public RepostOnMastodon() | |
{ | |
this.client = new AuthenticationClient("something.social"); | |
} | |
[FunctionName("RepostOnMastodon")] |
This file contains 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
// <copyright> | |
// Copyright (c) Kontron AIS GmbH. All rights reserved. | |
// </copyright> | |
using System.Collections.Generic; | |
using System.Linq; | |
using JetBrains.Annotations; | |
using Nuke.Common; | |
using Nuke.Common.CI; | |
using Nuke.Common.CI.AzurePipelines; |
This file contains 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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
try | |
{ | |
await Task.WhenAll( | |
Task.Run(() => | |
{ | |
Console.WriteLine("begin one"); |
This file contains 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
public class Person | |
{ | |
public initonly string Firstname { get; } | |
public initonly string Lastname { get; } | |
}; | |
enum class ByteOrBool { byte Y; bool B;} | |
enum class MixedType | |
{ |
This file contains 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
public class MyCaliburnBootstrapper : BootstrapperBase | |
{ | |
private IHost? host; | |
protected MyCaliburnBootstrapper() | |
{ | |
this.Initialize(); | |
} | |
private IHost BuildHost() |
This file contains 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
private Task completion = Task.CompletedTask; | |
private int counter; | |
private async void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
this.completion = this.completion.ContinueWith(async _ => | |
{ | |
this.counter = this.counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); |
This file contains 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
private Task completion = Task.CompletedTask; | |
private int counter; | |
private void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
this.completion = this.completion.ContinueWith(async _ => | |
{ | |
this.counter = this.counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); |
This file contains 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
private int counter = 0; | |
private async void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
counter = counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); | |
Debug.WriteLine($"Exit ButtonOnClick {counter}"); | |
} | |
public async Task DoSubAsync(int number) | |
{ |
NewerOlder