Search Results for

    Show / Hide Table of Contents
    note

    VeloxDB is still in beta and APIs are subject to change. We are in the process of completing the documentation, so some sections may be incomplete or empty at this time.

    Class DatabasePropertyAttribute

    Specifies that the property is a database property.

    Inheritance
    object
    Attribute
    DatabasePropertyAttribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.GetType()
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: VeloxDB.ObjectInterface
    Assembly: vlxdb.dll
    Syntax
    public sealed class DatabasePropertyAttribute : Attribute

    Remarks

    Apply the DatabasePropertyAttribute to properties of DatabaseObject that need to be persisted. Database properties must be abstract, with both getter and setter defined.

    Database properties can be of following types:

    • byte
    • short
    • int
    • long
    • float
    • double
    • bool
    • System.DateTime
    • string
    • DatabaseArray<T>
    Note

    Default values are not supported for DatabaseArray<T> and string types.

    Examples

    [DatabaseClass]
    public abstract partial class Vehicle : DatabaseObject
    {
        [DatabaseProperty]
        public abstract double PositionX { get; set; }
    
        [DatabaseProperty]
        public abstract double PositionY { get; set; }
    
        [DatabaseProperty]
        public abstract string ModelName { get; set; }
    
        [DatabaseProperty]
        public abstract int Year { get; set; }
    
        [DatabaseProperty("5")]
        public abstract int PassengerCapacity { get; set; }
    
        [InverseReferences(nameof(Ride.Vehicle))]
        public abstract InverseReferenceSet<Ride> Rides { get; }
    
        public Vehicle()
        {
        }
    }
    

    Constructors

    DatabasePropertyAttribute(object)

    Declaration
    public DatabasePropertyAttribute(object defaultValue = null)
    Parameters
    Type Name Description
    object defaultValue

    Specifies the default value for the property.

    Properties

    DefaultValue

    Gets the default value for the property.

    Declaration
    public object DefaultValue { get; }
    Property Value
    Type Description
    object

    See Also

    DatabaseReferenceAttribute
    In this article
    © 2025 Copyright: VeloxDB