CompileDocumentType() 공개 정적인 메소드

public static CompileDocumentType ( Type baseType, Type>.IDictionary fields ) : Type
baseType System.Type
fields Type>.IDictionary
리턴 System.Type
        private Type CreateDynamicTypeForCollection(string collectionName, Dictionary <string, Type> providerTypes)
        {
            var fields = new Dictionary <string, Type>();

            providerTypes.Where(x => x.Key.StartsWith(collectionName + ".")).ToList()
            .ForEach(x => fields.Add(x.Key.Split('.').Last(), x.Value));
            return(DocumentTypeBuilder.CompileDocumentType(typeof(object), fields));
        }
예제 #2
0
        private Type CreateDynamicTypes(Func <string, bool> criteria, Dictionary <string, Type> providerTypes, Dictionary <string, Type> generatedTypes)
        {
            var fieldTypes = providerTypes.Where(x => criteria(x.Key));

            var fields = fieldTypes.ToDictionary(
                x => x.Key.Split('.').Last(),
                x => GetDynamicTypeForProviderType(x.Key, x.Value, providerTypes, generatedTypes));

            return(DocumentTypeBuilder.CompileDocumentType(typeof(object), fields));
        }