public static PartConventionBuilder <PartConvention> ForTypesAssignableFrom <T>( this PartConventionBuilder <PartConvention> builder) { Predicate <Type> condition = t => typeof(T).IsAssignableFrom(t) && !t.IsInterface && t.IsPublic; builder.ProvideValueFor(x => x.Condition, condition); return(builder); }
public static PartConventionBuilder <PartConvention> ForType <T>( this PartConventionBuilder <PartConvention> builder) { Predicate <Type> condition = t => typeof(T) == t; builder.ProvideValueFor(x => x.Condition, condition); return(builder); }
public static PartConventionBuilder <PartConvention> ForTypesWhereNamespaceContains( this PartConventionBuilder <PartConvention> builder, string value) { if (value == null) { throw new ArgumentNullException("value"); } Predicate <Type> condition = t => t.Namespace != null && t.Namespace.Contains(value) && !t.IsInterface && t.IsPublic; builder.ProvideValueFor(x => x.Condition, condition); return(builder); }
public static PartConventionBuilder <PartConvention> ForTypesWithName( this PartConventionBuilder <PartConvention> builder, string name) { if (name == null) { throw new ArgumentNullException("name"); } Predicate <Type> condition = t => t.Name.Equals(name) && !t.IsInterface && t.IsPublic; builder.ProvideValueFor(x => x.Condition, condition); return(builder); }