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 EventDispatcher : IDispatchEvents | |
{ | |
private readonly IDictionary<Type, Action<IDomainEvent>> handlers = new Dictionary<Type, Action<IDomainEvent>>(); | |
public virtual void Register<TEvent>(Action<TEvent> handler) | |
where TEvent : class, IDomainEvent | |
{ | |
// re-wrap delegate | |
this.handlers[typeof(TEvent)] = @event => handler(@event as TEvent); | |
} |
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
return EventStore.Wireup.Init() | |
.UsingSqlPersistence("EventStore") | |
.InitializeDatabaseSchema() | |
.UsingCustomSerializer(new JsonSerializer()) | |
.Compress() | |
.EncryptWith(EncryptionKey) | |
.UsingAsynchronousDispatcher() | |
.PublishTo(new DelegateMessagePublisher(DispatchCommit)) | |
.HandleExceptionsWith(DispatchErrorHandler) | |
.Build(); |
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
/** | |
* Inherit prototype properties | |
* @param {Function} ctor | |
* @param {Function} superCtor | |
*/ | |
_.mixin({ | |
inherits: (function(){ | |
function noop(){} | |
function ecma3(ctor, superCtor) { |
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 AccountSpecifications | |
{ | |
public Specification when_constructing_an_account = new | |
ConstructorSpecification<Account>() | |
{ | |
When = () => new Account("Jane Smith", 17), | |
Expect = | |
{ | |
account => account.AccountHolderName == "Jane Smith", | |
account => account.UniqueIdentifier == 17, |
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
[TestFixture] | |
public class SpecificationFixture | |
{ | |
[Test, TestCaseSource("GetSpecificationTestCases")] | |
public void Verify(SpecificationToRun spec) | |
{ | |
var runner = new SpecificationRunner(); | |
RunResult result = runner.RunSpecifciation(spec); | |
if (result.Passed) |
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
@ECHO OFF | |
:: Installs all Nuget packages for all Projects, Recursively. | |
:: Ignores Resharper folders | |
:: DOS Help - http://www.dostips.com/forum/viewtopic.php?f=3&t=431 | |
SET NUGET="Nuget.exe" | |
SET SOLUTIONDIR=..\src | |
ECHO. | |
ECHO Finding Projects in Solution... (saving to ProjectsUsingNuget.log.txt) | |
ECHO ------------------------------ |
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
// Restify server config here | |
var server = restify.createServer({ | |
name: 'restify-test', | |
version: '1.0.0', | |
}); | |
// ... | |
// Connect config here | |
var connectApp = connect() |
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
@model EditUserModel | |
@using (Html.BeginForm()) | |
{ | |
<div> | |
@Html.HiddenFor(m => m.Id) | |
@Html.TextBoxFor(m => m.FirstName) | |
@Html.TextBoxFor(m => m.LastName) | |
@Html.DropDownListFor(m => m.CountryId, Model.Countries) | |
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
@model UserViewModel | |
@using (Html.BeginForm()) | |
{ | |
<div> | |
@Html.HiddenFor(m => m.Id) | |
@Html.TextBoxFor(m => m.FirstName) | |
@Html.TextBoxFor(m => m.LastName) | |
@Html.DropDownListFor(m => m.CountryId, Model.Countries) | |
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
(function(_, Backbone) { | |
var defaultFilter = function() {return true;}; | |
/** | |
* This represents a filtered collection. You can either pass a filter or | |
* invoke setFilter(filter) to give a filter. The filter is identical to | |
* that which is used for _.select(array, filter) | |
* | |
* false filter indicates no filtering. | |
* |
OlderNewer