当前位置: 首页>>代码示例>>C#>>正文


C# IPropertyMap.GetAllColumnMaps方法代码示例

本文整理汇总了C#中IPropertyMap.GetAllColumnMaps方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyMap.GetAllColumnMaps方法的具体用法?C# IPropertyMap.GetAllColumnMaps怎么用?C# IPropertyMap.GetAllColumnMaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPropertyMap的用法示例。


在下文中一共展示了IPropertyMap.GetAllColumnMaps方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateDLinqOneToManyFields

        /*

        private System.Nullable<int> _ReportsTo;

        private EntityRef<Employee> _ReportsToEmployee;

         * */
        public static void GenerateDLinqOneToManyFields(IClassMap classMap, IPropertyMap propertyMap, CodeTypeDeclaration classDecl)
        {
            foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
            {
                string fieldName = propertyMap.GenerateMemberName(columnMap.Name);

                CodeMemberField fieldMember = new CodeMemberField() ;
                fieldMember.Name = fieldName;

                //Add code for adding Nullable generics when OM is ported to .NET 2.0

                CodeTypeReference typeReference = new CodeTypeReference(columnMap.GetSystemType());
                fieldMember.Type = typeReference;

                classDecl.Members.Add(fieldMember);
            }
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:24,代码来源:CodeDomGenerator.cs

示例2: GetPropertyColumnNamesAndAliases

        public virtual void GetPropertyColumnNamesAndAliases(IPropertyMap propertyMap, object hash, Hashtable columns, ArrayList order, string path, string propPath, string suggestion)
        {
            if (hash == null) { hash = propertyMap; }
            SqlTableAlias tbl = sqlEmitter.GetTableAlias(propertyMap.MustGetTableMap(), hash)  ;
            IList columnAliases = new ArrayList();

            if (propertyMap.IsIdentity)
            {
                IClassMap classMap = propertyMap.ClassMap;
                IColumnMap typeColumnMap = classMap.GetTypeColumnMap();
                if (typeColumnMap != null)
                {
                    string pathParent = GetPathParent(path);
                    string suggestedPath = pathParent.Length == 0 ? "NPersistTypeColumn" : pathParent + ".NPersistTypeColumn";
                    SqlColumnAlias column = GetPropertyColumnAlias(tbl, suggestedPath , typeColumnMap, suggestedPath);
                    columnAliases.Add(column);
                }
            }

            if (suggestion == "")
                suggestion = propPath;
              //      bool hasTypeColumn = false;

            IPropertyMap inverse = propertyMap.GetInversePropertyMap();

            //Type column first
            if (inverse != null)
            {
                IColumnMap inverseTypeColumnMap = inverse.ClassMap.GetTypeColumnMap();
                foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
                {
                    if (inverseTypeColumnMap != null && inverseTypeColumnMap == columnMap.GetPrimaryKeyColumnMap())
                    {
                        string suggestionString;
                        suggestionString = propPath.Length == 0 ? "NPersistTypeColum" : propPath + ".NPersistTypeColumn";

                        SqlColumnAlias column = GetPropertyColumnAlias(tbl, path, columnMap, suggestionString);
                        columnAliases.Add(column);
                    }
                }
            }

            foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
            {
                if (inverse != null)
                {
                    IColumnMap inverseTypeColumnMap = inverse.ClassMap.GetTypeColumnMap();
                    if ( inverseTypeColumnMap != null && inverseTypeColumnMap == columnMap.GetPrimaryKeyColumnMap())
                    {
                        continue;
                    }
                }

                string suggestionString;

                suggestionString = suggestion;

                SqlColumnAlias column = GetPropertyColumnAlias(tbl, path, columnMap, suggestionString);
                columnAliases.Add(column);
            }

            foreach (SqlColumnAlias column in columnAliases)
            {

                if (!(columns.ContainsKey(column)))
                {
                    columns[column] = column;
                    order.Add(column);

                    //Note: Important stuff, right here in nowhere-ville!!
                    if (this.sqlEmitter.PropertyColumnMap.ContainsKey(propPath))
                    {
                        ArrayList arrAliases;
                        if (this.sqlEmitter.PropertyColumnMap[propPath] is string)
                        {
                            arrAliases = new ArrayList() ;
                            arrAliases.Add(this.sqlEmitter.PropertyColumnMap[propPath]);
                            this.sqlEmitter.PropertyColumnMap[propPath] = arrAliases;
                        }
                        else
                        {
                            arrAliases = (ArrayList) this.sqlEmitter.PropertyColumnMap[propPath];
                        }
                        arrAliases.Add(column.Alias);
                    }
                    else
                    {
                        this.sqlEmitter.PropertyColumnMap[propPath] = column.Alias;
                    }
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:92,代码来源:PropertyPathTraverser.cs

示例3: GenerateDLinqOneToManyProperties

        public static void GenerateDLinqOneToManyProperties(IClassMap classMap, IPropertyMap propertyMap, CodeTypeDeclaration classDecl)
        {
            foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
            {
                string fieldName = propertyMap.GenerateMemberName(columnMap.Name);
                string typeName = columnMap.GetSystemType().ToString();

                CodeMemberProperty propertyMember = GenerateDLinqPrimitiveProperty(propertyMap, columnMap.Name, fieldName, typeName);

                classDecl.Members.Add(propertyMember);
            }
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:12,代码来源:CodeDomGenerator.cs


注:本文中的IPropertyMap.GetAllColumnMaps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。