コード例 #1
0
        private TableItem(Type type)
        {
            _EntityType = type;
            _Table      = type.GetCustomAttribute <BindTableAttribute>(true);
            if (_Table == null)
            {
                throw new ArgumentOutOfRangeException("type", "类型" + type + "没有" + typeof(BindTableAttribute).Name + "特性!");
            }

            _Indexes        = type.GetCustomAttributes <BindIndexAttribute>(true).ToArray();
            _Relations      = type.GetCustomAttributes <BindRelationAttribute>(true).ToArray();
            _Description    = type.GetCustomAttribute <DescriptionAttribute>(true);
            _ModelCheckMode = type.GetCustomAttribute <ModelCheckModeAttribute>(true);

            InitFields();
        }
コード例 #2
0
ファイル: TableItem.cs プロジェクト: windygu/asxinyunet
        private TableItem(Type type)
        {
            _EntityType = type;
            _Table = type.GetCustomAttribute<BindTableAttribute>(true);
            if (_Table == null) throw new ArgumentOutOfRangeException("type", "类型" + type + "没有" + typeof(BindTableAttribute).Name + "特性!");

            _Indexes = type.GetCustomAttributes<BindIndexAttribute>(true);
            _Relations = type.GetCustomAttributes<BindRelationAttribute>(true);

            _Description = type.GetCustomAttribute<DescriptionAttribute>(true);

            _ModelCheckMode = type.GetCustomAttribute<ModelCheckModeAttribute>(true);

            InitFields();
        }