示例#1
0
        public static BasePropertyMetadata MapToBase(DBPropertyModel propertyMetadata)
        {
            BasePropertyMetadata propertyModel = new BasePropertyMetadata
            {
                Name         = propertyMetadata.Name,
                TypeMetadata = DBTypeMapper.EmitReferenceDTG(propertyMetadata.TypeMetadata)
            };

            return(propertyModel);
        }
示例#2
0
        public static BaseParameterMetadata MapToBase(DBParameterModel parameterMetadata)
        {
            BaseParameterMetadata parameterModel = new BaseParameterMetadata
            {
                ParameterName = parameterMetadata.Name,
                TypeMetadata  = DBTypeMapper.EmitReferenceDTG(parameterMetadata.TypeMetadata),
            };

            return(parameterModel);
        }
示例#3
0
        public static DBPropertyModel MapToDB(BasePropertyMetadata propertyMetadata)
        {
            DBPropertyModel propertyModel = new DBPropertyModel
            {
                Name         = propertyMetadata.Name,
                TypeMetadata = DBTypeMapper.EmitReferenceDatabase(propertyMetadata.TypeMetadata)
            };

            return(propertyModel);
        }
示例#4
0
        private static BaseTypeMetadata EmitReturnTypeDTG(DBMethodModel method)
        {
            DBMethodModel methodInfo = method as DBMethodModel;

            if (methodInfo == null)
            {
                return(null);
            }
            return(DBTypeMapper.EmitReferenceDTG(methodInfo.ReturnType));
        }
示例#5
0
        public static DBParameterModel MapToDB(BaseParameterMetadata parameterMetadata)
        {
            DBParameterModel parameterModel = new DBParameterModel
            {
                Name         = parameterMetadata.ParameterName,
                TypeMetadata = DBTypeMapper.EmitReferenceDatabase(parameterMetadata.TypeMetadata),
            };

            return(parameterModel);
        }
示例#6
0
        private static DBTypeModel EmitReturnTypeDatabase(BaseMethodMetadata method)
        {
            BaseMethodMetadata methodInfo = method as BaseMethodMetadata;

            if (methodInfo == null)
            {
                return(null);
            }
            return(DBTypeMapper.EmitReferenceDatabase(methodInfo.ReturnType));
        }
示例#7
0
        public static BaseMethodMetadata MapToBase(DBMethodModel methodMetadata)
        {
            BaseMethodMetadata methodModel = new BaseMethodMetadata
            {
                MethodName       = methodMetadata.Name,
                GenericArguments = DBTypeMapper.EmitGenericArgumentsDTG(methodMetadata.GenericArgumentsL),
                ReturnType       = EmitReturnTypeDTG(methodMetadata),
                Parameters       = EmitParametersDTG(methodMetadata.ParametersL),
            };

            return(methodModel);
        }
示例#8
0
        public static DBMethodModel MapToDB(BaseMethodMetadata methodMetadata)
        {
            DBMethodModel methodModel = new DBMethodModel
            {
                Name             = methodMetadata.MethodName,
                GenericArguments = DBTypeMapper.EmitGenericArgumentsDatabase(methodMetadata.GenericArguments),
                ReturnType       = EmitReturnTypeDatabase(methodMetadata),
                Parameters       = EmitParametersDatabase(methodMetadata.Parameters),
            };

            return(methodModel);
        }
示例#9
0
        public static BaseNamespaceMetadata MapToBase(DBNamespaceModel namespaceMetadata)
        {
            var m_NamespaceName = namespaceMetadata.NamespaceName;

            foreach (var type in namespaceMetadata.TypesL)
            {
                Dictionares.TypeDictonaryToDTG[type] = DBTypeMapper.MapToBase(type);
            }
            var m_Types = from type in namespaceMetadata.TypesL orderby type.TypeName select DBTypeMapper.fillType(Dictionares.TypeDictonaryToDTG[type], type);

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

            return(namespaceModel);
        }
示例#10
0
        public static DBNamespaceModel MapToDB(BaseNamespaceMetadata namespaceMetadata)
        {
            var m_NamespaceName = namespaceMetadata.NamespaceName;

            foreach (var type in namespaceMetadata.Types)
            {
                Dictionares.TypeDictonaryToDatabase[type] = DBTypeMapper.MapToDB(type);
            }
            var m_Types = from type in namespaceMetadata.Types orderby type.TypeName select DBTypeMapper.FillTypeDatabase(Dictionares.TypeDictonaryToDatabase[type], type);

            foreach (var t in m_Types)
            {
                t.NamespaceName = m_NamespaceName;
            }
            DBNamespaceModel namespaceModel = new DBNamespaceModel
            {
                NamespaceName = m_NamespaceName,
                Types         = m_Types
            };

            return(namespaceModel);
        }