Beispiel #1
0
        private string GetRelationTable(Type type1, Type type2)
        {
            string table1 = MetaDataHelper.GetTableName(type1);
            string table2 = MetaDataHelper.GetTableName(type2);

            return(table1 + '_' + table2);
        }
Beispiel #2
0
        internal MetaData(Type type)
        {
            RelationColumns = new Dictionary <string, PropertyEx>(StringComparer.OrdinalIgnoreCase);
            Properties      = new Dictionary <string, PropertyEx>(StringComparer.OrdinalIgnoreCase);
            var typeAttr = TypeDescriptor.GetAttributes(type);

            var arrs = TypeDescriptor.GetProperties(type);

            TableName = MetaDataHelper.GetTableName(type);
            for (int idx = 0; idx < arrs.Count; idx++)
            {
                var prop = PropertyEx.Create(arrs[idx]);
                Properties[prop.Name] = prop;

                if (prop is IDProperty)
                {
                    KeyColumn = (IDProperty)prop;
                }
            }
        }
Beispiel #3
0
 private string GetReferenceID(Type type)
 {
     return(MetaDataHelper.GetTableName(type) + "Id");
 }