public static IAutoSpecNodeMapBuilder AddBoth(this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specType) { autoSpecNodeMapBuilder.Add(specType); autoSpecNodeMapBuilder.AddNot(specType); return(autoSpecNodeMapBuilder); }
public static IAutoSpecNodeMapBuilder AddForTypes( this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specOpenGenericType, IEnumerable <Type> types) { AssertOpenGenericSpecType(specOpenGenericType); var addBothMethodInfo = typeof(AutoSpecNodeMapBuilderExt).GetMethod(nameof(AddBoth), BindingFlags.Static | BindingFlags.Public); foreach (var type in types) { var specType = specOpenGenericType.MakeGenericType(type); addBothMethodInfo !.Invoke(autoSpecNodeMapBuilder, new object[] { autoSpecNodeMapBuilder, specType }); } return(autoSpecNodeMapBuilder); }
public static IAutoSpecNodeMapBuilder AddForAllEmbeddedTypes( this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specOpenGenericType) => autoSpecNodeMapBuilder.AddForTypes(specOpenGenericType, EmbeddedTypes);
public static IAutoSpecNodeMapBuilder AddForRefEmbeddedTypes( this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specOpenGenericType) => autoSpecNodeMapBuilder.AddForTypes(specOpenGenericType, EmbeddedTypes.Where(t => !t.IsValueType));