コード例 #1
0
 public static ConventionBase <IType, IIdExtractor> IdByMethod(
     this ConventionBuilder <IType, IIdExtractor> source, Func <IMethod, bool> filter,
     Func <PropertyValueExtractor, PropertyValueExtractor> configurationDelegate
     ) => source.By(t => configurationDelegate(BuildRoutine.IdExtractor()
                                               .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())))
 as DelegateBasedConvention <IType, IIdExtractor>;
コード例 #2
0
 public static ConventionBase <IType, IIdExtractor> IdByProperty(
     this ConventionBuilder <IType, IIdExtractor> source, Func <IProperty, bool> filter,
     Func <PropertyValueExtractor, PropertyValueExtractor> configurationDelegate
     ) => source
 .By(t => configurationDelegate(BuildRoutine.IdExtractor().ByPropertyValue(t.Properties.First(filter))))
 .When(t => t.Properties.Any(filter));
コード例 #3
0
 public static ConventionBase <TFrom, IIdExtractor> Id <TFrom>(
     this ConventionBuilder <TFrom, IIdExtractor> source,
     Func <IdExtractorBuilder, IIdExtractor> idExtractorDelegate
     ) => source.Constant(idExtractorDelegate(BuildRoutine.IdExtractor()));