nHydrate.Generator.Models.Table.GetRelatedTypeTableByColumn C# (CSharp) 메소드

GetRelatedTypeTableByColumn() 공개 메소드

public GetRelatedTypeTableByColumn ( Column column, bool fullHierarchy, string &roleName ) : Table
column Column
fullHierarchy bool
roleName string
리턴 Table
        public Table GetRelatedTypeTableByColumn(Column column, bool fullHierarchy, out string roleName)
        {
            roleName = string.Empty;
            foreach (var relation in this.GetRelationsWhereChild(fullHierarchy))
            {
                var parentTable = relation.ParentTableRef.Object as Table;
                //Type tables have 1 PK
                if (parentTable.Generated && relation.ColumnRelationships.Count == 1)
                {
                    var parentColumn = relation.ColumnRelationships[0].ParentColumnRef.Object as Column;
                    var childColumn = relation.ColumnRelationships[0].ChildColumnRef.Object as Column;
                    if ((column == childColumn) && parentTable.TypedTable != TypedTableConstants.None)
                    {
                        roleName = relation.PascalRoleName;
                        return parentTable;
                    }
                }
            }
            return null;
        }

Same methods

Table::GetRelatedTypeTableByColumn ( Column column, string &roleName ) : Table