This file contains hidden or 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 interface IValidationQuery | |
{ | |
IEnumerable<IValidationRule> RulesFor(object target); | |
IEnumerable<IValidationRule> RulesFor(Type targetType); | |
T GetRule<T>(Accessor accessor) where T : class, IValidationRule; | |
T GetStrategy<T>(Accessor accessor) where T : class, IFieldValidationStrategy; | |
void ForRule<T>(Accessor accessor, Action<T, Accessor> action) where T : class, IValidationRule; | |
void ForStrategy<T>(Accessor accessor, Action<T, Accessor> action) where T : class, IFieldValidationStrategy; | |
bool HasRule<T>(Accessor accessor) where T : class, IValidationRule; | |
bool HasStrategy<T>(Accessor accessor) where T : class, IFieldValidationStrategy; |
This file contains hidden or 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 void Invoke() | |
{ | |
if (performInvoke() == DoNext.Continue && InsideBehavior != null) | |
{ | |
InsideBehavior.Invoke(); | |
} | |
afterInsideBehavior(); | |
} |
This file contains hidden or 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 interface IPartialDecorator<T> | |
where T : class | |
{ | |
T Enrich(T target); | |
} |
This file contains hidden or 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
// TODO -- come back and clean this up. Just getting it up and running for a demo | |
BehaviorDetailsModel root = null; | |
var behaviors = new Cache<Type, BehaviorDetailsModel>(t => | |
{ | |
var model = new BehaviorDetailsModel {BehaviorType = t}; | |
if(root == null) | |
{ | |
root = model; | |
} |
This file contains hidden or 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 RequiresAuthenticationConvention : IConfigurationAction | |
{ | |
public void Configure(BehaviorGraph graph) | |
{ | |
graph | |
.Actions() | |
.Where(action => action.HasInput && !action.InputType().HasAttribute<AllowUnauthenticatedAccessAttribute>()) | |
.Each(call => | |
{ | |
var log = graph.Observer; |
This file contains hidden or 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 interface ISpecification<T> | |
{ | |
Expression<Func<T, bool>> IsSatisfied(); | |
} |
This file contains hidden or 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 virtual IQueryable<T> Query(ISpecification<T> query) | |
{ | |
var specifications = new List<ISpecification<T>>(); | |
_specificationPolicies | |
.Where(p => p.Applies<T>()) | |
.Select(p => p.Build<T>()) | |
.Each(specifications.Add); | |
_entityPolicies |
This file contains hidden or 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 ApplicationSetting : ISiteContextualEntity | |
{ | |
public string Key { get; set; } | |
public string Value { get; set; } | |
public int SiteId { get; set; } | |
public Site Site { get; set; } | |
} |
This file contains hidden or 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
jBus.routing.initialize(function() { | |
this.connectTo('ws://jmarnold-logist:8181'); | |
this.on('TimestampCaseCommand', function(msg) { | |
$('#Case1').find('.checkpoint-' + msg.Checkpoint).html(msg.Value); | |
}); | |
this.on('PulseCommand', function(msg) { | |
$('#Pulse').html(msg.Message); | |
}); | |
}); |
This file contains hidden or 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 SampleDashboardModel | |
{ | |
public IEnumerable<IDashboardWidget> Widgets { get; set; | |
} |