Skip to main content

Namespace ServiceStack.DataAnnotations

Classes

AddColumnAttribute

Add Column during Db.Migrate, optional as adding columns are implied

AliasAttribute

Map C# Type Name to a different RDBMS Table name or a Property Name to a different RDBMS Column name

AlterColumnAttribute

AutoIdAttribute

Auto populate Property with RDBMS generated UUID if supported otherwise with a new C# GUID

AutoIncrementAttribute

Auto populate Primary Key Property with an RDBMS generated Auto Incrementing serial Integer

BelongToAttribute

Populate property from ambiguous column name in the specified joined table type

CheckConstraintAttribute

Create an RDBMS Check Constraint on a Table column

CompositeIndexAttribute

Create an Composite RDBMS Index and optional Unique constraint

CompositeKeyAttribute

ComputeAttribute

Compute attribute. Use to indicate that a property is a Calculated Field. Use [Persisted] attribute to persist column

ComputedAttribute

Ignore calculated C# Property from being persisted in RDBMS Table

CustomFieldAttribute

Create RDBMS using Custom SQL Data Type

CustomInsertAttribute

Populate INSERT parameter with Custom SQL expression, e.g. [CustomInsert("crypt({0}, gen_salt('bf'))")]

CustomSelectAttribute

Populate property with Custom SELECT expression, e.g. [CustomSelect("Width * Height")]

CustomUpdateAttribute

Populate UPDATE parameter with Custom SQL expression, e.g. [CustomUpdate("crypt({0}, gen_salt('bf'))")]

DecimalLengthAttribute

DefaultAttribute

Create RDBMS Column definition with specified default value

DescriptionAttribute

Annotate any Type, Property or Enum with a textual description

EnumAsCharAttribute

Save Enum value as single char in RDBMS column

EnumAsIntAttribute

Save Enum integer value in RDBMS column

ExcludeAttribute

ExcludeMetadataAttribute

Exclude API from all Metadata Services

ForeignKeyAttribute

Define an RDBMS Foreign Key Relationship

HashKeyAttribute

Hash Key Attribute used to specify which property is the HashKey, e.g. in DynamoDb.

IdAttribute

Uniquely identify C# Types and properties with a unique integer in gRPC Services

IgnoreAttribute

Ignore property from consideration as an RDBMS column. Properties with this attribute are ignored in all SQL.

IgnoreOnInsertAttribute

Ignore this property in INSERT statements

IgnoreOnSelectAttribute

Ignore this property in SELECT statements

IgnoreOnUpdateAttribute

Ignore this property in UPDATE statements

IndexAttribute

Create an RDBMS Column Index

MapColumnAttribute

MetaAttribute

Decorate any type or property with custom metadata

PersistedAttribute

Whether to persist calculated column

PgSqlBigIntArrayAttribute

PgSqlDecimalArrayAttribute

PgSqlDoubleArrayAttribute

PgSqlFloatArrayAttribute

PgSqlHStoreAttribute

PgSqlIntArrayAttribute

PgSqlJsonAttribute

PgSqlJsonBAttribute

PgSqlLongArrayAttribute

PgSqlShortArrayAttribute

PgSqlTextArrayAttribute

PgSqlTimestampArrayAttribute

PgSqlTimestampAttribute

PgSqlTimestampTzArrayAttribute

PgSqlTimestampTzAttribute

PostCreateTableAttribute

Run Custom SQL immediately after RDBMS table is created

PostDropTableAttribute

Run Custom SQL immediately after RDBMS table is dropped

PreCreateTableAttribute

Run Custom SQL immediately before RDBMS table is created

PreDropTableAttribute

Run Custom SQL immediately before RDBMS table is dropped

PrimaryKeyAttribute

Treat this property is the Primary Key of the table

RangeAttribute

Document the allowable min and max range for this property

RangeKeyAttribute

Range Key Attribute used to specify which property is the RangeKey, e.g. in DynamoDb.

ReferenceAttribute

Define this property as containing a POCO Complex Type Reference

ReferenceFieldAttribute

Populate with a field from a foreign table in AutoQuery and Load* APIs

ReferencesAttribute

Document a reference to an external Type, used to create simple Foreign Key references

RemoveColumnAttribute

Remove Column during Db.Migrate

RenameColumnAttribute

Remove Column during Db.Migrate

RequiredAttribute

Create NOT NULL Column Definitions in RDBMS Create Table statements Use [ValidateNotNull] to use https://docs.servicestack.net/validation to enforce a not null property

ReturnOnInsertAttribute

Indicate the property should be included in the returning/output clause of INSERT SQL Statements

RowVersionAttribute

Treat property as an automatically incremented RDBMS Row Version

SchemaAttribute

Define which RDBMS Schema Data Model belongs to

SequenceAttribute

Use in FirebirdSql. indicates name of generator for columns of type AutoIncrement

SqlServerBucketCountAttribute

SqlServerCollateAttribute

SqlServerFileTableAttribute

SqlServerMemoryOptimizedAttribute

StringLengthAttribute

Define the RDBMS Column Definition variable character length

UniqueAttribute

Define a unique RDBMS column constraint

UniqueConstraintAttribute

Define a unique multi column RDBMS column constraint

UniqueIdAttribute

Enums

SqlServerDurability