PortableDefaults
Factory methods for portable defaults.
public static class PortableDefaults
Properties
True
public static BoolDefault True { get; }
Boolean true.
False
public static BoolDefault False { get; }
Boolean false.
NewUuid
public static NewUuidDefault NewUuid { get; }
Generate a new random UUID.
CurrentTimestamp
public static CurrentTimestampDefault CurrentTimestamp { get; }
Current timestamp (without timezone).
CurrentTimestampTz
public static CurrentTimestampTzDefault CurrentTimestampTz { get; }
Current timestamp with timezone.
CurrentDate
public static CurrentDateDefault CurrentDate { get; }
Current date only.
CurrentTime
public static CurrentTimeDefault CurrentTime { get; }
Current time only.
Null
public static NullDefault Null { get; }
Explicit NULL default.
Methods
Literal(string)
public static LiteralDefault Literal(string expression)
Literal SQL expression (no translation).
Parameters:
| Name | Type | Description |
|---|---|---|
expression |
String |
Returns: LiteralDefault
String(string)
public static StringDefault String(string value)
String literal, properly quoted.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
String |
Returns: StringDefault
Int(long)
public static IntDefault Int(long value)
Integer literal.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Int64 |
Returns: IntDefault
Decimal(decimal)
public static DecimalDefault Decimal(decimal value)
Decimal literal.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Decimal |
Returns: DecimalDefault
Bool(bool)
public static BoolDefault Bool(bool value)
Boolean literal (true/false on Postgres, 1/0 on SQLite).
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Boolean |
Returns: BoolDefault
NextSequence(string)
public static NextSequenceDefault NextSequence(string sequenceName)
Next value from a sequence.
Parameters:
| Name | Type | Description |
|---|---|---|
sequenceName |
String |
Returns: NextSequenceDefault