public static ConventionBase <IType, IValueExtractor> ValueByMethod( this ConventionBuilder <IType, IValueExtractor> source, Func <IMethod, bool> filter, Func <PropertyValueExtractor, PropertyValueExtractor> configurationDelegate ) => source .By(t => configurationDelegate(BuildRoutine.ValueExtractor() .ByPropertyValue(new MethodAsProperty( t.Methods.First(filter.And(o => o.HasNoParameters() && !o.ReturnsVoid())) )) )) .When(t => t.Methods.Any(filter.And(o => o.HasNoParameters() && !o.ReturnsVoid())));
public static ConventionBase <IType, IValueExtractor> ValueByProperty( this ConventionBuilder <IType, IValueExtractor> source, Func <IProperty, bool> filter, Func <PropertyValueExtractor, PropertyValueExtractor> configurationDelegate ) => source .By(t => configurationDelegate(BuildRoutine.ValueExtractor().ByPropertyValue(t.Properties.First(filter)))) .When(t => t.Properties.Any(filter));
public static ConventionBase <TFrom, IValueExtractor> Value <TFrom>( this ConventionBuilder <TFrom, IValueExtractor> source, Func <ValueExtractorBuilder, IValueExtractor> valueExtractorDelegate ) => source.Constant(valueExtractorDelegate(BuildRoutine.ValueExtractor()));