Table of Contents

Class PrimaryKeyAttribute

Namespace
Supabase.Postgrest.Attributes
Assembly
Supabase.Postgrest.dll

Used to map a C# property to a Postgrest PrimaryKey.

[AttributeUsage(AttributeTargets.Property)]
public class PrimaryKeyAttribute : Attribute
Inheritance
PrimaryKeyAttribute
Inherited Members

Examples

class User : BaseModel {
    [PrimaryKey("id")]
    public string Id {get; set;}
}

Constructors

PrimaryKeyAttribute(string?, bool)

public PrimaryKeyAttribute(string? columnName = null, bool shouldInsert = false)

Parameters

columnName string
shouldInsert bool

Properties

ColumnName

public string ColumnName { get; }

Property Value

string

ShouldInsert

Would be set to false in the event that the database handles the generation of this property.

public bool ShouldInsert { get; }

Property Value

bool