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
using System.Text; | |
using System.Text.Json; | |
using Microsoft.AspNetCore.Mvc.Infrastructure; | |
namespace Demo.Middleware; | |
public class HostDebuggerOptions | |
{ | |
public string RouteDebuggerPath { get; set; } = "/route-debugger"; |
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 static class Program | |
{ | |
public static int Main(string[] args) | |
{ | |
// azure home directory | |
var homeDirectory = Environment.GetEnvironmentVariable("HOME") ?? "."; | |
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Verbose() | |
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
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 readonly struct ConcurrencyToken : IEquatable<ConcurrencyToken> | |
{ | |
public static readonly ConcurrencyToken None = new(Array.Empty<byte>()); | |
public byte[] Value { get; } | |
public ConcurrencyToken(byte[] value) | |
{ | |
Value = value ?? Array.Empty<byte>(); | |
} |
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
[MemoryDiagnoser] | |
public class BenchmarkSwitch | |
{ | |
[Params(typeof(int), typeof(DateTimeOffset), typeof(TimeSpan))] | |
public Type TargetType { get; set; } = typeof(int); | |
[Benchmark(Baseline = true)] | |
public int BaseLineBenchmark() | |
{ | |
if (TargetType == typeof(string)) |
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
([\w._]+)\.Should\(\)\.NotBeNull\(\) | |
Assert.NotNull($1) | |
([\w._]+)\.Should\(\)\.NotBeEmpty\(\) | |
Assert.NotEmpty($1) | |
([\w.!_]+)\.Should\(\)\.Be\(([\w.!_" ]+)\) | |
Assert.Equal($2, $1) | |
([\w._]+)\.Should\(\)\.BeTrue\(\) |
OlderNewer