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
Properties
ColumnName
public string ColumnName { get; }
Property Value
ShouldInsert
Would be set to false in the event that the database handles the generation of this property.
public bool ShouldInsert { get; }