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.Tasks; | |
public static class Catch | |
{ | |
public static async Task<Optional<Exception>> ExceptionAsync(Func<Task> action) | |
{ | |
var result = Optional<Exception>.Empty; | |
try | |
{ |
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 EventRouter | |
{ | |
private readonly Dictionary<Type, Action<object>> _handlers; | |
public EventRouter() | |
{ | |
_handlers = new Dictionary<Type, Action<object>>(); | |
} | |
public void Register<T>(Action<T> handler) |
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; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
namespace AggregateSourceInGist | |
{ | |
public interface IEventRouter | |
{ |
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
/// <summary> | |
/// Represent a connected projection. | |
/// </summary> | |
public abstract class ConnectedProjection<TConnection> | |
{ | |
private readonly List<ConnectedProjectionHandler<TConnection>> _handlers; | |
/// <summary> | |
/// Initializes a new instance of the <see cref="ConnectedProjection{TConnection}" /> class. | |
/// </summary> |
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.Net; | |
using NUnit.Framework; | |
using Projac.Redis; | |
using Recipes.Shared; | |
using StackExchange.Redis; | |
namespace Recipes.RedisIntegration | |
{ | |
public class Usage |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Projac; | |
namespace ConsoleApplication666 | |
{ | |
public class AsyncProjector |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace IAmScaredOfMonstersInTheDark | |
{ | |
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
public class AggregateReader | |
{ | |
private readonly Func<IAggregateRootEntity> _rootFactory; | |
private readonly IEventStoreConnection _connection; | |
private readonly EventStoreReaderConfiguration _configuration; | |
public AggregateReader( | |
Func<IAggregateRootEntity> rootFactory, | |
IEventStoreConnection connection, | |
EventStoreReaderConfiguration configuration) |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> | |
</startup> | |
<system.data> | |
<DbProviderFactories> | |
<add name="SQLite Data Provider" invariant="System.Data.SQLite" | |
description="ADO.NET Data Provider for SQLite" | |
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> |