Skip to content

Instantly share code, notes, and snippets.

Rhys Sharrem rhyss

Block or report user

Report or block rhyss

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
@rhyss
rhyss / CommandValidator.cs
Created Apr 6, 2012 — forked from PaulUpson/CommandValidator.cs
Validation within Aggregate Roots - Part 2
View CommandValidator.cs
public interface IValidationHandler<in T> where T : Command {
bool Validate(T cmd);
}
public interface ICommandValidator {
bool Validate<T>(T command) where T : Command;
}
// Allows for all command validators to be registered on app start
public class CommandValidator : ICommandValidator {
private readonly IDictionary<Type, Func<object, bool>> _validationHandlers = new Dictionary<Type, Func<object, bool>>();
You can’t perform that action at this time.