Exemplo n.º 1
0
        public DataModelMemberDescriptor(LinqToDB.Mapping.ColumnDescriptor columnDescriptor, ITableDescriptor table)
        {
            Name           = columnDescriptor.MemberName;
            Table          = table;
            PropertyInfoEx = new PropertyInfoEx(columnDescriptor.MemberInfo as PropertyInfo);

            //var propertyInfo = entity.EntityType.GetProperty(property.Name);
            //PropertyInfoEx = new PropertyInfoEx(propertyInfo);

            //if (property.IsCollectionType)
            //    MemberType = EntityMemberType.CollectionProperty;
            ////else if (property.isna) Navigation???
            //else
            //    MemberType = EntityMemberType.ValueProperty;
        }
Exemplo n.º 2
0
        //Nullable
        //DefaultValue
        //

        public DataModelPropertyDescriptor(LinqToDB.Mapping.ColumnDescriptor columnDescriptor, ITableDescriptor table)
            : base(columnDescriptor, table)
            //: base(entity, table, property)
        {
            MemberType      = EntityMemberType.ValueProperty;
            PrimaryKeyIndex = columnDescriptor.IsPrimaryKey ?
                              (columnDescriptor.PrimaryKeyOrder >= 0 ? columnDescriptor.PrimaryKeyOrder : 0)
                : -1;
            IsCalculated    = columnDescriptor.IsIdentity;
            IsAutoIncrement = columnDescriptor.IsIdentity;
            //NotMapped = property.notm
            NotUpdatable = !IsCalculated;
            ColumnName   = columnDescriptor.ColumnName;
            DbTypeName   = columnDescriptor.DbType;
            //columnDescriptor.DataType = LinqToDB.DataType.
            //columnDescriptor.
        }