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
// Result | |
type Success<S> = { success: true, value: S } | |
type Failure<F> = { success: false, message: F } | |
type Bindable<S, F> = { | |
bind: <B,>(func: (input: S) => Result<B, F>) => Result<B, F> | |
} | |
type Result<S, F> = (Success<S> | Failure<F>) & Bindable<S, F> |
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
namespace EventHandlersByReflection; | |
using System.Reflection; | |
using static System.Console; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var thing = new ThingWithEvents(); |
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 System.Linq; | |
namespace Trading.Backend.Events.Contracts.Tests | |
{ | |
public static class TopologicalTest | |
{ | |
public static void ShouldCorrectlyOrderNodes() | |
{ |
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.Threading; | |
using System.Threading.Tasks; | |
using static System.Console; | |
namespace SimpleConsoleLoop | |
{ | |
class Program | |
{ | |
static Task Main() |
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 EasyNetQ.Logging; | |
using Microsoft.Extensions.Logging; | |
// use like this... | |
// LogProvider.SetCurrentLogProvider(new EasyNetQMicrosoftExtensionsLogProvider(loggerProvider)); | |
// RabbitHutch.CreateBus(..); | |
namespace Logging | |
{ |
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 Microsoft.Extensions.Logging.Console; | |
using Microsoft.Extensions.Options; | |
using System; | |
namespace Sample | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
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 Microsoft.Extensions.DependencyInjection; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace MyNamespace | |
{ | |
public class ServiceCollectionWriter | |
{ |
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 XmlElement FaultFromException(Exception exception) | |
=> (exception is TargetInvocationException targetInvocationException) | |
? FaultFromException(targetInvocationException.InnerException) | |
: (exception is SonosException sonosException) | |
? XmlElementFromFault(new SoapFault | |
{ | |
FaultCode = sonosException.FaultCode, | |
FaultString = sonosException.FaultString, | |
Detail = sonosException.Detail | |
}) |
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
{ | |
"albums": [ | |
{ | |
"id": "1234", | |
"price": { | |
"amount": 12, | |
"currency": "EUR", | |
"vatAmount": 2.4 | |
} | |
} |
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.Linq; | |
using System.Threading.Tasks; | |
using Xunit; | |
namespace MyProject.Tests | |
{ | |
public class AsyncNamingConventionTests | |
{ | |
[Fact] |
NewerOlder