The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

DbTypeAttribute Class

Specifies the database type of the column that a property is mapped to.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true)]
public sealed class DbTypeAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Property Or AttributeTargets.Field, Inherited:=True)>
Public NotInheritable Class DbTypeAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
public sealed class DbTypeAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Field Or AttributeTargets.Property, Inherited:=True)>
Public NotInheritable Class DbTypeAttribute
    Inherits Attribute

Remarks

The DbTypeAttribute can be used to designate a provider-specific database type for the column which the persistent property or field is mapped to:


public class MyPersistentObject : XPObject {
    // ...
    DateTime myReadDate;
    [DbType("smalldatetime")]
    public DateTime ReadDate {
        get { return myReadDate; }
        set {
                myReadDate = value;
        }
    }
}

Inheritance

Object
Attribute
DbTypeAttribute
See Also