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 DatabaseClassAttribute

    Specifies that the class is Database Class.

    Inheritance
    object
    Attribute
    DatabaseClassAttribute
    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 DatabaseClassAttribute : Attribute

    Remarks

    Apply the DatabaseClassAttribute to classes that are part of the model. A database class must fulfill the following requirements:

    • It must be declared as abstract
    • It must inherit from DatabaseObject
    • It must have an empty constructor
    • Properties that need to be persisted must be marked with DatabasePropertyAttribute
    • Persisted properties must be abstract with both getter and setter defined

    Examples

    [DatabaseClass]
    public abstract partial class Post : DatabaseObject
    {
        [DatabaseProperty]
        public abstract string Title { get; set; }
    
        [DatabaseProperty]
        public abstract string Content { get; set; }
    
        [DatabaseReference(false, DeleteTargetAction.CascadeDelete, true)]
        public abstract Blog Blog { get; set; }
    
        public partial PostDTO ToDTO();
        public static partial Post FromDTO(ObjectModel om, PostDTO post);
    }
    

    Constructors

    DatabaseClassAttribute(bool)

    Declaration
    public DatabaseClassAttribute(bool isAbstract = false)
    Parameters
    Type Name Description
    bool isAbstract

    Specifies whether this class is an abstract class. Abstract classes cannot be instantiated and can only be inherited.

    Properties

    IsAbstract

    Get whether the class is abstract.

    Declaration
    public bool IsAbstract { get; }
    Property Value
    Type Description
    bool
    In this article
    © 2025 Copyright: VeloxDB