Esempio n. 1
0
        private static DTGTypeMetadata EmitReturnTypeDTG(DatabaseMethodMetadata method)
        {
            DatabaseMethodMetadata methodInfo = method as DatabaseMethodMetadata;

            if (methodInfo == null)
            {
                return(null);
            }
            return(DatabaseTypeMapper.EmitReferenceDTG(methodInfo.ReturnType));
        }
        public static DatabaseParameterMetadata MapToDatabase(DTGParameterMetadata parameterMetadata)
        {
            DatabaseParameterMetadata parameterModel = new DatabaseParameterMetadata
            {
                Name         = parameterMetadata.Name,
                TypeMetadata = DatabaseTypeMapper.EmitReferenceDatabase(parameterMetadata.TypeMetadata),
            };

            return(parameterModel);
        }
        public static DatabasePropertyMetadata MapToDatabase(DTGPropertyMetadata propertyMetadata)
        {
            DatabasePropertyMetadata propertyModel = new DatabasePropertyMetadata
            {
                Name         = propertyMetadata.Name,
                TypeMetadata = DatabaseTypeMapper.EmitReferenceDatabase(propertyMetadata.TypeMetadata)
            };

            return(propertyModel);
        }
Esempio n. 4
0
        public static DatabaseMethodMetadata MapToDatabase(DTGMethodMetadata methodMetadata)
        {
            DatabaseMethodMetadata methodModel = new DatabaseMethodMetadata
            {
                Name             = methodMetadata.Name,
                GenericArguments = DatabaseTypeMapper.EmitGenericArgumentsDatabase(methodMetadata.GenericArguments),
                ReturnType       = EmitReturnTypeDatabase(methodMetadata),
                Parameters       = EmitParametersDatabase(methodMetadata.Parameters),
            };

            return(methodModel);
        }
        public static DTGNamespaceMetadata MapToDTG(DatabaseNamespaceMetadata namespaceMetadata)
        {
            var m_NamespaceName = namespaceMetadata.NamespaceName;

            //May be even more beneficial to create all types from all namespaces beforehand
            foreach (var type in namespaceMetadata.TypesL)
            {
                HelperDictonaries.TypeDictonaryToDTG[type] = DatabaseTypeMapper.MapToDTG(type);
            }
            var m_Types = from type in namespaceMetadata.TypesL orderby type.TypeName select DatabaseTypeMapper.fillType(HelperDictonaries.TypeDictonaryToDTG[type], type);

            DTGNamespaceMetadata namespaceModel = new DTGNamespaceMetadata
            {
                NamespaceName = m_NamespaceName,
                Types         = m_Types
            };

            return(namespaceModel);
        }