Skip to content

Instantly share code, notes, and snippets.

👔
ceci n'est pas une cravate

Yves Reynhout yreynhout

👔
ceci n'est pas une cravate
Block or report user

Report or block yreynhout

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Example.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />
@yreynhout
yreynhout / FunWithBaskets.cs
Created Jun 8, 2018
How can I use child entities?
View FunWithBaskets.cs
public class Basket : EventSource
{
private int Id;
private List<Item> Items = new List<Item>();
public Basket()
{
On<ItemAddedToBasket>(e => {
var item = new Item(@event =>
View keybase.io
### Keybase proof
I hereby claim:
* I am yreynhout on github.
* I am yvesreynhout (https://keybase.io/yvesreynhout) on keybase.
* I have a public key ASBOIjadZDfe7txFECcB6kg9Ar-IQirADJFzByx9TDZwcgo
To claim this, I am signing this object:
@yreynhout
yreynhout / EventStoreCollection.cs
Last active Sep 27, 2018
Recipe for an EventStoreFixture using Docker.DotNet
View EventStoreCollection.cs
using Xunit;
namespace TheDukesOfDocker
{
[CollectionDefinition(nameof(EventStoreCollection))]
public class EventStoreCollection : ICollectionFixture<EventStoreFixture>
{
}
}
@yreynhout
yreynhout / Position.fs
Created Sep 21, 2016
Did you get that one?
View Position.fs
// Value objects à la F#
type Position =
struct
val Value : int64
new (value) = { Value = value } then
if value < 0L then invalidArg "value" "The value must be greater than or equal to 0."
member this.Next =
if this.Value = Int64.MaxValue then
invalidOp (sprintf "There's no next value beyond %d" Int64.MaxValue)
new Position(this.Value + 1L)
View Falkor.fsx
open System
module PlayerAccount =
//PlayerWasInvited
//PlayerAcceptedInvitation
//PlayerRejectedInvitation
//PlayerInvitationWasCancelled
//
type ProfessionalOccupation = Employee | Independent | Labourer | Other
View FrojacMeetsSql.fsx
#r "packages/Paramol/lib/net45/Paramol.dll"
open System
open System.Data
open System.Data.Common
open Paramol
open Paramol.SqlClient
type PortfolioCreated = { PortfolioId: Guid; Name:String; When: DateTimeOffset; }
type PortfolioRenamed = { PortfolioId: Guid; Name:String; When: DateTimeOffset; }
@yreynhout
yreynhout / KickIt.cs
Last active Dec 22, 2015
System.Runtime.Caching meets Projac.Connector
View KickIt.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using KellermanSoftware.CompareNetObjects;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
@yreynhout
yreynhout / Catch.cs
Last active Mar 4, 2018
Async Aggregate Source Command Handler Testing ... in a gist
View Catch.cs
using System;
using System.Threading.Tasks;
public static class Catch
{
public static async Task<Optional<Exception>> ExceptionAsync(Func<Task> action)
{
var result = Optional<Exception>.Empty;
try
{
View SimplezNo.cs
public class EventRouter
{
private readonly Dictionary<Type, Action<object>> _handlers;
public EventRouter()
{
_handlers = new Dictionary<Type, Action<object>>();
}
public void Register<T>(Action<T> handler)
You can’t perform that action at this time.