Class NpgsqlPropertyBuilderExtensions
Npgsql specific extension methods for
Namespace: Microsoft.EntityFrameworkCore
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public static class NpgsqlPropertyBuilderExtensions
Methods
| Improve this Doc View SourceCanSetCompressionMethod(IConventionPropertyBuilder, string?, bool)
Whether the compression method for the column can be set.
Declaration
public static bool CanSetCompressionMethod(this IConventionPropertyBuilder propertyBuilder, string? compressionMethod, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | compressionMethod | The compression method. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
bool |
|
Remarks
This feature was introduced in PostgreSQL 14.
CanSetHiLoSequence(IConventionPropertyBuilder, string?, string?, bool)
Returns a value indicating whether the given name and schema can be set for the hi-lo sequence.
Declaration
public static bool CanSetHiLoSequence(this IConventionPropertyBuilder propertyBuilder, string? name, string? schema, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
bool |
|
CanSetIdentityOptions(IConventionPropertyBuilder, long?, long?, long?, long?, bool?, long?)
Returns a value indicating whether the sequence options can be set on the identity column.
Declaration
public static bool CanSetIdentityOptions(this IConventionPropertyBuilder propertyBuilder, long? startValue = null, long? incrementBy = null, long? minValue = null, long? maxValue = null, bool? cyclic = null, long? numbersToCache = null)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
long? | startValue | The starting value for the sequence. The default starting value is |
long? | incrementBy | The amount to increment between values. Defaults to 1. |
long? | minValue | The minimum value for the sequence. The default for an ascending sequence is 1. The default for a descending sequence is the minimum value of the data type. |
long? | maxValue | The maximum value for the sequence. The default for an ascending sequence is the maximum value of the data type. The default for a descending sequence is -1. |
bool? | cyclic | Sets whether or not the sequence will start again from the beginning once the maximum value is reached. Defaults to false. |
long? | numbersToCache | Specifies how many sequence numbers are to be pre-allocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default. |
Returns
Type | Description |
---|---|
bool | The same builder instance so that multiple calls can be chained. |
CanSetIsGeneratedTsVectorColumn(IConventionPropertyBuilder, string?, IReadOnlyList<string>?, bool)
Returns a value indicating whether the property can be configured as a full-text search tsvector column.
Declaration
public static bool CanSetIsGeneratedTsVectorColumn(this IConventionPropertyBuilder propertyBuilder, string? config, IReadOnlyList<string>? includedPropertyNames, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | config |
The text search configuration for this generated tsvector property, or See https://www.postgresql.org/docs/current/textsearch-controls.html for more information. |
IReadOnlyList<><string>? | includedPropertyNames | An array of property names to be included in the tsvector. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
bool |
|
CanSetSequence(IConventionPropertyBuilder, string?, string?, bool)
Returns a value indicating whether the given name and schema can be set for the key value generation sequence.
Declaration
public static bool CanSetSequence(this IConventionPropertyBuilder propertyBuilder, string? name, string? schema, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
bool | true if the given name and schema can be set for the key value generation sequence. |
CanSetValueGenerationStrategy(IConventionPropertyBuilder, NpgsqlValueGenerationStrategy?, bool)
Returns a value indicating whether the given value can be set as the value generation strategy.
Declaration
public static bool CanSetValueGenerationStrategy(this IConventionPropertyBuilder propertyBuilder, NpgsqlValueGenerationStrategy? valueGenerationStrategy, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
NpgsqlValueGenerationStrategy? | valueGenerationStrategy | The value generation strategy. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
bool |
|
HasHiLoSequence(IConventionPropertyBuilder, string?, string?, bool)
Configures the database sequence used for the hi-lo pattern to generate values for the key property, when targeting SQL Server.
Declaration
public static IConventionSequenceBuilder? HasHiLoSequence(this IConventionPropertyBuilder propertyBuilder, string? name, string? schema, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
IConventionSequenceBuilder? | A builder to further configure the sequence. |
HasIdentityOptions(IConventionPropertyBuilder, long?, long?, long?, long?, bool?, long?)
Sets the sequence options on an identity column. The column must be set as identity via UseIdentityColumn(PropertyBuilder) or UseIdentityAlwaysColumn(PropertyBuilder).
Declaration
public static IConventionPropertyBuilder? HasIdentityOptions(this IConventionPropertyBuilder propertyBuilder, long? startValue = null, long? incrementBy = null, long? minValue = null, long? maxValue = null, bool? cyclic = null, long? numbersToCache = null)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
long? | startValue | The starting value for the sequence.
The default starting value is |
long? | incrementBy | The amount to increment between values. Defaults to 1. |
long? | minValue | The minimum value for the sequence. The default for an ascending sequence is 1. The default for a descending sequence is the minimum value of the data type. |
long? | maxValue | The maximum value for the sequence. The default for an ascending sequence is the maximum value of the data type. The default for a descending sequence is -1. |
bool? | cyclic | Sets whether or not the sequence will start again from the beginning once the maximum value is reached. Defaults to false. |
long? | numbersToCache | Specifies how many sequence numbers are to be pre-allocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default. |
Returns
Type | Description |
---|---|
IConventionPropertyBuilder? | The same builder instance so that multiple calls can be chained. |
HasIdentityOptions(PropertyBuilder, long?, long?, long?, long?, bool?, long?)
Sets the sequence options on an identity column. The column must be set as identity via UseIdentityColumn(PropertyBuilder) or UseIdentityAlwaysColumn(PropertyBuilder).
Declaration
public static PropertyBuilder HasIdentityOptions(this PropertyBuilder propertyBuilder, long? startValue = null, long? incrementBy = null, long? minValue = null, long? maxValue = null, bool? cyclic = null, long? numbersToCache = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
long? | startValue | The starting value for the sequence.
The default starting value is |
long? | incrementBy | The amount to increment between values. Defaults to 1. |
long? | minValue | The minimum value for the sequence. The default for an ascending sequence is 1. The default for a descending sequence is the minimum value of the data type. |
long? | maxValue | The maximum value for the sequence. The default for an ascending sequence is the maximum value of the data type. The default for a descending sequence is -1. |
bool? | cyclic | Sets whether or not the sequence will start again from the beginning once the maximum value is reached. Defaults to false. |
long? | numbersToCache | Specifies how many sequence numbers are to be pre0allocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
HasIdentityOptions<TProperty>(PropertyBuilder<TProperty>, long?, long?, long?, long?, bool?, long?)
Sets the sequence options on an identity column. The column must be set as identity via UseIdentityColumn(PropertyBuilder) or UseIdentityAlwaysColumn(PropertyBuilder).
Declaration
public static PropertyBuilder<TProperty> HasIdentityOptions<TProperty>(this PropertyBuilder<TProperty> propertyBuilder, long? startValue = null, long? incrementBy = null, long? minValue = null, long? maxValue = null, bool? cyclic = null, long? numbersToCache = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
long? | startValue | The starting value for the sequence.
The default starting value is |
long? | incrementBy | The amount to increment between values. Defaults to 1. |
long? | minValue | The minimum value for the sequence. The default for an ascending sequence is 1. The default for a descending sequence is the minimum value of the data type. |
long? | maxValue | The maximum value for the sequence. The default for an ascending sequence is the maximum value of the data type. The default for a descending sequence is -1. |
bool? | cyclic | Sets whether or not the sequence will start again from the beginning once the maximum value is reached. Defaults to false. |
long? | numbersToCache | Specifies how many sequence numbers are to be pre-allocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache), and this is also the default. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty |
HasPostgresArrayConversion<TElementProperty, TElementProvider>(PropertyBuilder<TElementProperty[]>, Expression<Func<TElementProperty, TElementProvider>>, Expression<Func<TElementProvider, TElementProperty>>)
Configures a PostgreSQL array conversion.
Declaration
public static PropertyBuilder<TElementProperty[]> HasPostgresArrayConversion<TElementProperty, TElementProvider>(this PropertyBuilder<TElementProperty[]> propertyBuilder, Expression<Func<TElementProperty, TElementProvider>> convertToProviderExpression, Expression<Func<TElementProvider, TElementProperty>> convertFromProviderExpression)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TElementProperty[]> | propertyBuilder | |
Expression<><Func<, ><TElementProperty, TElementProvider>> | convertToProviderExpression | |
Expression<><Func<, ><TElementProvider, TElementProperty>> | convertFromProviderExpression |
Returns
Type | Description |
---|---|
PropertyBuilder<><TElementProperty[]> |
Type Parameters
Name | Description |
---|---|
TElementProperty | |
TElementProvider |
HasPostgresArrayConversion<TElementProperty, TElementProvider>(PropertyBuilder<TElementProperty[]>, ValueConverter)
Configures a PostgreSQL array conversion.
Declaration
public static PropertyBuilder<TElementProperty[]> HasPostgresArrayConversion<TElementProperty, TElementProvider>(this PropertyBuilder<TElementProperty[]> propertyBuilder, ValueConverter elementValueConverter)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TElementProperty[]> | propertyBuilder | |
ValueConverter | elementValueConverter |
Returns
Type | Description |
---|---|
PropertyBuilder<><TElementProperty[]> |
Type Parameters
Name | Description |
---|---|
TElementProperty | |
TElementProvider |
HasPostgresArrayConversion<TElementProperty, TElementProvider>(PropertyBuilder<List<TElementProperty>>, Expression<Func<TElementProperty, TElementProvider>>, Expression<Func<TElementProvider, TElementProperty>>)
Configures a PostgreSQL array conversion.
Declaration
public static PropertyBuilder<List<TElementProperty>> HasPostgresArrayConversion<TElementProperty, TElementProvider>(this PropertyBuilder<List<TElementProperty>> propertyBuilder, Expression<Func<TElementProperty, TElementProvider>> convertToProviderExpression, Expression<Func<TElementProvider, TElementProperty>> convertFromProviderExpression)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><List<><TElementProperty>> | propertyBuilder | |
Expression<><Func<, ><TElementProperty, TElementProvider>> | convertToProviderExpression | |
Expression<><Func<, ><TElementProvider, TElementProperty>> | convertFromProviderExpression |
Returns
Type | Description |
---|---|
PropertyBuilder<><List<><TElementProperty>> |
Type Parameters
Name | Description |
---|---|
TElementProperty | |
TElementProvider |
HasPostgresArrayConversion<TElementProperty, TElementProvider>(PropertyBuilder<List<TElementProperty>>, ValueConverter)
Configures a PostgreSQL array conversion.
Declaration
public static PropertyBuilder<List<TElementProperty>> HasPostgresArrayConversion<TElementProperty, TElementProvider>(this PropertyBuilder<List<TElementProperty>> propertyBuilder, ValueConverter elementValueConverter)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><List<><TElementProperty>> | propertyBuilder | |
ValueConverter | elementValueConverter |
Returns
Type | Description |
---|---|
PropertyBuilder<><List<><TElementProperty>> |
Type Parameters
Name | Description |
---|---|
TElementProperty | |
TElementProvider |
HasSequence(IConventionPropertyBuilder, string?, string?, bool)
Configures the database sequence used for the key value generation pattern to generate values for the key property, when targeting PostgreSQL.
Declaration
public static IConventionSequenceBuilder? HasSequence(this IConventionPropertyBuilder propertyBuilder, string? name, string? schema, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
IConventionSequenceBuilder? | A builder to further configure the sequence. |
HasValueGenerationStrategy(IConventionPropertyBuilder, NpgsqlValueGenerationStrategy?, bool)
Configures the value generation strategy for the key property, when targeting PostgreSQL.
Declaration
public static IConventionPropertyBuilder? HasValueGenerationStrategy(this IConventionPropertyBuilder propertyBuilder, NpgsqlValueGenerationStrategy? valueGenerationStrategy, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
NpgsqlValueGenerationStrategy? | valueGenerationStrategy | The value generation strategy. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
IConventionPropertyBuilder? | The same builder instance if the configuration was applied, |
IsGeneratedTsVectorColumn(IConventionPropertyBuilder, string, IReadOnlyList<string>, bool)
Configures the property to be a full-text search tsvector column over the given properties.
Declaration
public static IConventionPropertyBuilder? IsGeneratedTsVectorColumn(this IConventionPropertyBuilder propertyBuilder, string config, IReadOnlyList<string> includedPropertyNames, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string | config | The text search configuration for this generated tsvector property. See https://www.postgresql.org/docs/current/textsearch-controls.html for more information. |
IReadOnlyList<><string> | includedPropertyNames | An array of property names to be included in the tsvector. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
IConventionPropertyBuilder? | The same builder instance if the configuration was applied,
|
IsGeneratedTsVectorColumn(PropertyBuilder, string, params string[])
Configures the property to be a full-text search tsvector column over the given properties.
Declaration
public static PropertyBuilder IsGeneratedTsVectorColumn(this PropertyBuilder propertyBuilder, string config, params string[] includedPropertyNames)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
string | config |
The text search configuration for this generated tsvector property, or See https://www.postgresql.org/docs/current/textsearch-controls.html for more information. |
string[] | includedPropertyNames | An array of property names to be included in the tsvector. |
Returns
Type | Description |
---|---|
PropertyBuilder | A builder to further configure the property. |
IsGeneratedTsVectorColumn(PropertyBuilder<NpgsqlTsVector>, string, params string[])
Configures the property to be a full-text search tsvector column over the given properties.
Declaration
public static PropertyBuilder<NpgsqlTsVector> IsGeneratedTsVectorColumn(this PropertyBuilder<NpgsqlTsVector> propertyBuilder, string config, params string[] includedPropertyNames)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><NpgsqlTsVector> | propertyBuilder | The builder for the property being configured. |
string | config |
The text search configuration for this generated tsvector property, or See https://www.postgresql.org/docs/current/textsearch-controls.html for more information. |
string[] | includedPropertyNames | An array of property names to be included in the tsvector. |
Returns
Type | Description |
---|---|
PropertyBuilder<><NpgsqlTsVector> | A builder to further configure the property. |
UseCompressionMethod(IConventionPropertyBuilder, string?, bool)
Sets the compression method for the column.
Declaration
public static IConventionPropertyBuilder? UseCompressionMethod(this IConventionPropertyBuilder propertyBuilder, string? compressionMethod, bool fromDataAnnotation = false)
Parameters
Type | Name | Description |
---|---|---|
IConventionPropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | compressionMethod | The compression method. |
bool | fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
IConventionPropertyBuilder? | A builder to further configure the property. |
Remarks
This feature was introduced in PostgreSQL 14.
UseCompressionMethod(PropertyBuilder, string?)
Sets the compression method for the column.
Declaration
public static PropertyBuilder UseCompressionMethod(this PropertyBuilder propertyBuilder, string? compressionMethod)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | compressionMethod | The compression method. |
Returns
Type | Description |
---|---|
PropertyBuilder | A builder to further configure the property. |
Remarks
This feature was introduced in PostgreSQL 14.
UseCompressionMethod<TEntity>(PropertyBuilder<TEntity>, string?)
Sets the compression method for the column.
Declaration
public static PropertyBuilder<TEntity> UseCompressionMethod<TEntity>(this PropertyBuilder<TEntity> propertyBuilder, string? compressionMethod)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TEntity> | propertyBuilder | The builder for the property being configured. |
string? | compressionMethod | The compression method. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TEntity> | A builder to further configure the property. |
Type Parameters
Name | Description |
---|---|
TEntity |
Remarks
This feature was introduced in PostgreSQL 14.
UseHiLo(PropertyBuilder, string?, string?)
Configures the property to use a sequence-based hi-lo pattern to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Declaration
public static PropertyBuilder UseHiLo(this PropertyBuilder propertyBuilder, string? name = null, string? schema = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The comment of the sequence. |
string? | schema | The schema of the sequence. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseHiLo<TProperty>(PropertyBuilder<TProperty>, string?, string?)
Configures the property to use a sequence-based hi-lo pattern to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Declaration
public static PropertyBuilder<TProperty> UseHiLo<TProperty>(this PropertyBuilder<TProperty> propertyBuilder, string? name = null, string? schema = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
string? | name | The comment of the sequence. |
string? | schema | The schema of the sequence. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty |
UseIdentityAlwaysColumn(PropertyBuilder)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Available only starting PostgreSQL 10.
Declaration
public static PropertyBuilder UseIdentityAlwaysColumn(this PropertyBuilder propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseIdentityAlwaysColumn<TProperty>(PropertyBuilder<TProperty>)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Available only starting PostgreSQL 10.
Declaration
public static PropertyBuilder<TProperty> UseIdentityAlwaysColumn<TProperty>(this PropertyBuilder<TProperty> propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty |
UseIdentityByDefaultColumn(PropertyBuilder)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
This is the default behavior when targeting PostgreSQL. Available only starting PostgreSQL 10.
Declaration
public static PropertyBuilder UseIdentityByDefaultColumn(this PropertyBuilder propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseIdentityByDefaultColumn<TProperty>(PropertyBuilder<TProperty>)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
This is the default behavior when targeting PostgreSQL. Available only starting PostgreSQL 10.
Declaration
public static PropertyBuilder<TProperty> UseIdentityByDefaultColumn<TProperty>(this PropertyBuilder<TProperty> propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property being configured. |
UseIdentityColumn(PropertyBuilder)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
This internally calls
Declaration
public static PropertyBuilder UseIdentityColumn(this PropertyBuilder propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseIdentityColumn<TProperty>(PropertyBuilder<TProperty>)
Configures the property to use the PostgreSQL IDENTITY feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
This internally calls
Declaration
public static PropertyBuilder<TProperty> UseIdentityColumn<TProperty>(this PropertyBuilder<TProperty> propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property being configured. |
UseSequence(PropertyBuilder, string?, string?)
Configures the key property to use a sequence-based key value generation pattern to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Declaration
public static PropertyBuilder UseSequence(this PropertyBuilder propertyBuilder, string? name = null, string? schema = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseSequence<TProperty>(PropertyBuilder<TProperty>, string?, string?)
Configures the key property to use a sequence-based key value generation pattern to generate values for new entities,
when targeting SQL Server. This method sets the property to be
Declaration
public static PropertyBuilder<TProperty> UseSequence<TProperty>(this PropertyBuilder<TProperty> propertyBuilder, string? name = null, string? schema = null)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
string? | name | The name of the sequence. |
string? | schema | The schema of the sequence. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property being configured. |
Remarks
See Modeling entity types and relationships, and Accessing SQL Server and SQL Azure databases with EF Core for more information and examples.
UseSerialColumn(PropertyBuilder)
Configures the property to use the PostgreSQL SERIAL feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Declaration
public static PropertyBuilder UseSerialColumn(this PropertyBuilder propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder | The same builder instance so that multiple calls can be chained. |
UseSerialColumn<TProperty>(PropertyBuilder<TProperty>)
Configures the property to use the PostgreSQL SERIAL feature to generate values for new entities,
when targeting PostgreSQL. This method sets the property to be
Declaration
public static PropertyBuilder<TProperty> UseSerialColumn<TProperty>(this PropertyBuilder<TProperty> propertyBuilder)
Parameters
Type | Name | Description |
---|---|---|
PropertyBuilder<><TProperty> | propertyBuilder | The builder for the property being configured. |
Returns
Type | Description |
---|---|
PropertyBuilder<><TProperty> | The same builder instance so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property being configured. |