예제 #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));