9using System.Web.UI.Design;
10using System.ComponentModel;
21 private Type _dataType;
22 private bool _primaryKey;
23 private bool _isIdentity;
24 private bool _isNullable;
26 private bool _isReadOnly;
28 private bool _nullable;
37 DataObjectFieldAttribute attribute =
38 (DataObjectFieldAttribute)
39 field.Attributes[typeof(DataObjectFieldAttribute)];
40 if (attribute !=
null)
42 _primaryKey = attribute.PrimaryKey;
43 _isIdentity = attribute.IsIdentity;
44 _isNullable = attribute.IsNullable;
45 _length = attribute.Length;
47 _dataType = Utilities.GetPropertyType(
49 _isReadOnly = field.IsReadOnly;
53 Type t = field.PropertyType;
54 if (!t.IsValueType || _isNullable)
59 _nullable = (t.GetGenericTypeDefinition() == typeof(Nullable<>));
87 get {
return _isIdentity; }
96 get {
return _isReadOnly; }
110 get {
return _primaryKey; }
123 get {
return _length; }
131 get {
return _name; }
148 {
return _nullable; }
171 get {
return _primaryKey; }
Contains schema information for a single object property.
bool Nullable
Gets a value indicating whether the property is nullable
Type DataType
Gets the data type of the property.
bool PrimaryKey
Gets a value indicating whether the property is a primary key value.
int Length
Gets the length of the property value.
bool Identity
Gets a value indicating whether this property is an identity key for the object.
int Precision
Gets the property's numeric precision.
ObjectFieldInfo(PropertyDescriptor field)
Creates an instance of the object.
bool IsUnique
Gets a value indicating whether this property must contain a unique value.
int Scale
Gets the property's scale.
string Name
Gets the property name.
bool IsReadOnly
Gets a value indicating whether this property is readonly.
@ Serializable
Prevents updating or inserting until the transaction is complete.