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 AutofacAppBuilder : IAppBuilder | |
{ | |
private readonly IAppBuilder _inner; | |
private readonly IContainer _container; | |
public AutofacAppBuilder( IAppBuilder inner, IContainer container ) | |
{ | |
_inner = inner; | |
_container = container; | |
} |
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
// Current ScheduleMe message creation ... | |
var typeName = typeNameSerializer.Serialize( typeof( T ) ); | |
var messageBody = serializer.MessageToBytes( message ); | |
var scheduleMe = new ScheduleMe | |
{ | |
WakeTime = futurePublishDate, | |
BindingKey = typeName, | |
CancellationKey = cancellationKey, | |
InnerMessage = messageBody | |
}; |
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
// Explicit opt-in message versioning via a marker interface and exchange to exchange bindings to | |
// route messages from publishing exchange to previous message version exchanges. | |
// Message serialisation adds all message versions into the message headers and deserialisation | |
// keeps trying the listed types until it finds one it can create (or runs out and throws an exception) | |
public interface ISupersede<T> where T : class { } |
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 Domain.Commands | |
{ | |
public interface ICommandInvoker | |
{ | |
// Extreme CQS - probably should have a version of execute that can return an Id<T> | |
void Execute<T>( T command ); | |
} | |
// If you alter the void Execute<T> in ICommandInvoker you will need to alter this as well | |
public interface ICommandHandler<T> |
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
<# | |
.Synopsis | |
Provides a PowerShell wrapper over MSDeploy. | |
.Description | |
Allows MSDeploy to be invoked via powershell without shelling out to Start-Process or cmd.exe. Abuses reflection and internal knowledge of the msdeploy exe - may fail on other versions | |
.Parameter Verb | |
Action to perform. |
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 OuterJoinExtensions | |
{ | |
public static IEnumerable<TResult> LeftOuterJoin( this IEnumerable<TLeft> left, IEnumerable<TRight> right, Func<TLeft, TLefTKey> leftKey, Func<TRight,TRightKey> rightKey, Func<TLeft,TRight,TResult> resultSelector ) | |
{ | |
return left.GroupJoin( right, leftKey, rightKey, (key,matches) => { Key = key, Matches = matches }) | |
.SelectMany( x => x.Matches.DefaultIfEmpty(), resultSelector); | |
} | |
} |
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.Web.Mvc; | |
using System.Web.Routing; | |
using GoFetchV2.Infrastructure; | |
namespace GoFetchV2.Web.Mvc | |
{ | |
/// <summary> | |
/// Conventions are as follows: | |
/// 1. All controllers must be registered in the container |
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
// Implementation of this basically looks up the appropriate command handler from a container | |
// and calls Handle passing the command | |
public interface ICommandExecutor | |
{ | |
Guid ExecuteCreate<T>( T createCommand ); | |
void Execute<T>( T command ); | |
} | |
public interface ICommandHandler<T> | |
{ |
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 ExtensionMethods; | |
namespace Events | |
{ | |
public static class DomainEvents | |
{ | |
private static IEventHandlerResolver _handlerResolver; | |
public static bool IsInitialised() |