예제 #1
0
        /// <summary>
        /// For the specified type, if it is a mapped type, use the Table
        /// metatype to get the correct inheritance metatype,
        /// otherwise create a new meta type.
        /// </summary>
        private MetaType GetMetaType(Type type)
        {
            MetaTable tbl = model.GetTable(type);

            if (tbl != null)
            {
                return(tbl.RowType.GetInheritanceType(type));
            }
            return(model.CreateRootType(null, type));
        }
예제 #2
0
        /// <summary>
        /// For the specified type, if it is a mapped type, use the Table
        /// metatype to get the correct inheritance metatype,
        /// otherwise create a new meta type.
        /// </summary>
        private MetaType GetMetaType(Type type)
        {
            // call no-lock version of GetTable since this function is called only in constructor
            // and constructor is only called by function that already has a lock.
            MetaTable tbl = model.GetTableNoLocks(type);

            if (tbl != null)
            {
                return(tbl.RowType.GetInheritanceType(type));
            }
            return(model.CreateRootType(null, type));
        }
 internal AttributedMetaTable(AttributedMetaModel model, TableAttribute attr, Type rowType)
 {
     this.model   = model;
     tableName    = string.IsNullOrEmpty(attr.Name) ? rowType.Name : attr.Name;
     this.rowType = model.CreateRootType(this, rowType);
 }