示例#1
0
 public static IAutoSpecNodeMapBuilder AddBoth(this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder,
                                               Type specType)
 {
     autoSpecNodeMapBuilder.Add(specType);
     autoSpecNodeMapBuilder.AddNot(specType);
     return(autoSpecNodeMapBuilder);
 }
示例#2
0
        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);
        }
示例#3
0
 public static IAutoSpecNodeMapBuilder AddForAllEmbeddedTypes(
     this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specOpenGenericType) =>
 autoSpecNodeMapBuilder.AddForTypes(specOpenGenericType, EmbeddedTypes);
示例#4
0
 public static IAutoSpecNodeMapBuilder AddForRefEmbeddedTypes(
     this IAutoSpecNodeMapBuilder autoSpecNodeMapBuilder, Type specOpenGenericType) =>
 autoSpecNodeMapBuilder.AddForTypes(specOpenGenericType, EmbeddedTypes.Where(t => !t.IsValueType));