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
// The explanation can be found here: https://wp.me/pa1cW1-2B | |
using System; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Threading.Tasks; | |
using Microsoft.Extensions.DependencyInjection; |
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
internal static class Program | |
{ | |
private static void Main() | |
{ | |
try | |
{ | |
ServiceRuntime.RegisterServiceAsync("SlowStatefulServiceType", | |
context => new SlowStatefulService(context)).GetAwaiter().GetResult(); | |
Thread.Sleep(Timeout.Infinite); |
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
internal static class Program | |
{ | |
private static void Main() | |
{ | |
try | |
{ | |
ServiceRuntime.RegisterServiceAsync("SlowStatelessServiceType", | |
context => new SlowStatelessService(context)).GetAwaiter().GetResult(); | |
Thread.Sleep(Timeout.Infinite); |
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 Demo | |
{ | |
public event EventHandler DemoEvent; | |
public void Raise() | |
{ | |
this.DemoEvent?.NaiveRaiseAsync(this, EventArgs.Empty).GetAwaiter().GetResult(); | |
Console.WriteLine("All handlers have been executed!"); | |
} | |
} |
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; | |
using System.Collections.Generic; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace Application | |
{ | |
public sealed class Query | |
{ | |
public readonly string StringValue; |