private void populate(Type type, IBindingContext context) { _typeCache.ForEachProperty(type, prop => { _propertyBinders.BinderFor(prop).Bind(prop, context); }); }
public void Bind(Type type, object instance, IBindingContext context) { var request = context.Service <IFubuRequest>(); _types.ForEachProperty(type, prop => { var value = request.Get(prop.PropertyType); prop.SetValue(instance, value, null); }); }
private ClassFieldValidationRules findRules(Type type) { var classRules = new ClassFieldValidationRules(); _typeDescriptors.ForEachProperty(type, property => { var accessor = new SingleProperty(property); var rules = _sources.SelectMany(x => x.RulesFor(property)).Distinct(); classRules.AddRules(accessor, rules); }); return(classRules); }
public void FillRules(ActionCall call) { var input = call.InputType(); if (input == null) { return; } _properties.ForEachProperty(input, property => { var accessor = new SingleProperty(property); var rules = _graph .Query() .RulesFor(accessor) .Where(rule => _remotes.IsRemote(rule)); rules.Each(rule => _remoteGraph.RegisterRule(accessor, rule)); }); }
private void write(object directive, Type type) { _types.ForEachProperty(type, prop => { var child = prop.GetValue(directive, null); if (prop.PropertyType.IsSimple()) { var stringValue = child == null ? string.Empty : child.ToString(); var name = "{0}{1}".ToFormat(_prefix, prop.Name); _writer.WriteProperty(name, stringValue); } else { if (child != null) { setPrefix(x => x.Push(prop.Name)); write(child, child.GetType()); setPrefix(x => x.Pop()); } } }); }
private void populate(Type type, IBindingContext context) { _typeCache.ForEachProperty(type, prop => PopulateProperty(type, prop, context)); }