Class NpgsqlModelExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
Model extension methods for Npgsql-specific metadata.
public static class NpgsqlModelExtensions
- Inheritance
-
NpgsqlModelExtensions
- Inherited Members
Remarks
Fields
DefaultHiLoSequenceName
The default name for the hi-lo sequence.
public const string DefaultHiLoSequenceName = "EntityFrameworkHiLoSequence"
Field Value
DefaultSequenceNameSuffix
The default prefix for sequences applied to properties.
public const string DefaultSequenceNameSuffix = "Sequence"
Field Value
Methods
GetCollations(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static IReadOnlyList<PostgresCollation> GetCollations(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
GetDatabaseTemplate(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static string? GetDatabaseTemplate(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
GetDatabaseTemplateConfigurationSource(IConventionModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static ConfigurationSource? GetDatabaseTemplateConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModel
Returns
GetHiLoSequenceName(IReadOnlyModel)
Returns the name to use for the default hi-lo sequence.
public static string GetHiLoSequenceName(this IReadOnlyModel model)
Parameters
model
IReadOnlyModelThe model.
Returns
- string
The name to use for the default hi-lo sequence.
GetHiLoSequenceNameConfigurationSource(IConventionModel)
Returns the ConfigurationSource for the default hi-lo sequence name.
public static ConfigurationSource? GetHiLoSequenceNameConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModelThe model.
Returns
- ConfigurationSource?
The ConfigurationSource for the default hi-lo sequence name.
GetHiLoSequenceSchema(IReadOnlyModel)
Returns the schema to use for the default hi-lo sequence. UseHiLo(PropertyBuilder, string?, string?)
public static string? GetHiLoSequenceSchema(this IReadOnlyModel model)
Parameters
model
IReadOnlyModelThe model.
Returns
- string
The schema to use for the default hi-lo sequence.
GetHiLoSequenceSchemaConfigurationSource(IConventionModel)
Returns the ConfigurationSource for the default hi-lo sequence schema.
public static ConfigurationSource? GetHiLoSequenceSchemaConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModelThe model.
Returns
- ConfigurationSource?
The ConfigurationSource for the default hi-lo sequence schema.
GetOrAddCollation(IMutableModel, string?, string, string, string, string?, bool?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresCollation GetOrAddCollation(this IMutableModel model, string? schema, string name, string lcCollate, string lcCtype, string? provider = null, bool? deterministic = null)
Parameters
model
IMutableModelschema
stringname
stringlcCollate
stringlcCtype
stringprovider
stringdeterministic
bool?
Returns
GetOrAddPostgresEnum(IConventionModel, string?, string, string[])
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresEnum GetOrAddPostgresEnum(this IConventionModel model, string? schema, string name, string[] labels)
Parameters
model
IConventionModelschema
stringname
stringlabels
string[]
Returns
GetOrAddPostgresEnum(IMutableModel, string?, string, string[])
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresEnum GetOrAddPostgresEnum(this IMutableModel model, string? schema, string name, string[] labels)
Parameters
model
IMutableModelschema
stringname
stringlabels
string[]
Returns
GetOrAddPostgresExtension(IConventionModel, string?, string, string?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresExtension GetOrAddPostgresExtension(this IConventionModel model, string? schema, string name, string? version)
Parameters
model
IConventionModelschema
stringname
stringversion
string
Returns
GetOrAddPostgresExtension(IMutableModel, string?, string, string?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresExtension GetOrAddPostgresExtension(this IMutableModel model, string? schema, string name, string? version)
Parameters
model
IMutableModelschema
stringname
stringversion
string
Returns
GetOrAddPostgresRange(IMutableModel, string?, string, string, string?, string?, string?, string?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static PostgresRange GetOrAddPostgresRange(this IMutableModel model, string? schema, string name, string subtype, string? canonicalFunction = null, string? subtypeOpClass = null, string? collation = null, string? subtypeDiff = null)
Parameters
model
IMutableModelschema
stringname
stringsubtype
stringcanonicalFunction
stringsubtypeOpClass
stringcollation
stringsubtypeDiff
string
Returns
GetPostgresEnums(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static IReadOnlyList<PostgresEnum> GetPostgresEnums(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
GetPostgresExtensions(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static IReadOnlyList<PostgresExtension> GetPostgresExtensions(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
GetSequenceNameSuffix(IReadOnlyModel)
Returns the suffix to append to the name of automatically created sequences.
public static string GetSequenceNameSuffix(this IReadOnlyModel model)
Parameters
model
IReadOnlyModelThe model.
Returns
- string
The name to use for the default key value generation sequence.
GetSequenceNameSuffixConfigurationSource(IConventionModel)
Returns the ConfigurationSource for the default value generation sequence name suffix.
public static ConfigurationSource? GetSequenceNameSuffixConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModelThe model.
Returns
- ConfigurationSource?
The ConfigurationSource for the default key value generation sequence name.
GetSequenceSchema(IReadOnlyModel)
Returns the schema to use for the default value generation sequence. UseSequence(PropertyBuilder, string?, string?)
public static string? GetSequenceSchema(this IReadOnlyModel model)
Parameters
model
IReadOnlyModelThe model.
Returns
- string
The schema to use for the default key value generation sequence.
GetSequenceSchemaConfigurationSource(IConventionModel)
Returns the ConfigurationSource for the default key value generation sequence schema.
public static ConfigurationSource? GetSequenceSchemaConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModelThe model.
Returns
- ConfigurationSource?
The ConfigurationSource for the default key value generation sequence schema.
GetTablespace(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static string? GetTablespace(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
GetTablespaceConfigurationSource(IConventionModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static ConfigurationSource? GetTablespaceConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModel
Returns
GetValueGenerationStrategy(IReadOnlyModel)
Returns the NpgsqlValueGenerationStrategy to use for properties of keys in the model, unless the property has a strategy explicitly set.
public static NpgsqlValueGenerationStrategy? GetValueGenerationStrategy(this IReadOnlyModel model)
Parameters
model
IReadOnlyModelThe model.
Returns
- NpgsqlValueGenerationStrategy?
The default NpgsqlValueGenerationStrategy.
GetValueGenerationStrategyConfigurationSource(IConventionModel)
Returns the ConfigurationSource for the default NpgsqlValueGenerationStrategy.
public static ConfigurationSource? GetValueGenerationStrategyConfigurationSource(this IConventionModel model)
Parameters
model
IConventionModelThe model.
Returns
- ConfigurationSource?
The ConfigurationSource for the default NpgsqlValueGenerationStrategy.
PostgresRanges(IReadOnlyModel)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static IReadOnlyList<PostgresRange> PostgresRanges(this IReadOnlyModel model)
Parameters
model
IReadOnlyModel
Returns
SetDatabaseTemplate(IConventionModel, string?, bool)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static string? SetDatabaseTemplate(this IConventionModel model, string? template, bool fromDataAnnotation = false)
Parameters
model
IConventionModeltemplate
stringfromDataAnnotation
bool
Returns
SetDatabaseTemplate(IMutableModel, string?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static void SetDatabaseTemplate(this IMutableModel model, string? template)
Parameters
model
IMutableModeltemplate
string
SetHiLoSequenceName(IConventionModel, string?, bool)
Sets the name to use for the default hi-lo sequence.
public static string? SetHiLoSequenceName(this IConventionModel model, string? name, bool fromDataAnnotation = false)
Parameters
model
IConventionModelThe model.
name
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
SetHiLoSequenceName(IMutableModel, string?)
Sets the name to use for the default hi-lo sequence.
public static void SetHiLoSequenceName(this IMutableModel model, string? name)
Parameters
model
IMutableModelThe model.
name
stringThe value to set.
SetHiLoSequenceSchema(IConventionModel, string?, bool)
Sets the schema to use for the default hi-lo sequence.
public static string? SetHiLoSequenceSchema(this IConventionModel model, string? value, bool fromDataAnnotation = false)
Parameters
model
IConventionModelThe model.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
SetHiLoSequenceSchema(IMutableModel, string?)
Sets the schema to use for the default hi-lo sequence.
public static void SetHiLoSequenceSchema(this IMutableModel model, string? value)
Parameters
model
IMutableModelThe model.
value
stringThe value to set.
SetSequenceNameSuffix(IConventionModel, string?, bool)
Sets the suffix to append to the name of automatically created sequences.
public static string? SetSequenceNameSuffix(this IConventionModel model, string? name, bool fromDataAnnotation = false)
Parameters
model
IConventionModelThe model.
name
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetSequenceNameSuffix(IMutableModel, string?)
Sets the suffix to append to the name of automatically created sequences.
public static void SetSequenceNameSuffix(this IMutableModel model, string? name)
Parameters
model
IMutableModelThe model.
name
stringThe value to set.
SetSequenceSchema(IConventionModel, string?, bool)
Sets the schema to use for the default key value generation sequence.
public static string? SetSequenceSchema(this IConventionModel model, string? value, bool fromDataAnnotation = false)
Parameters
model
IConventionModelThe model.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetSequenceSchema(IMutableModel, string?)
Sets the schema to use for the default key value generation sequence.
public static void SetSequenceSchema(this IMutableModel model, string? value)
Parameters
model
IMutableModelThe model.
value
stringThe value to set.
SetTablespace(IConventionModel, string?, bool)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static string? SetTablespace(this IConventionModel model, string? tablespace, bool fromDataAnnotation = false)
Parameters
model
IConventionModeltablespace
stringfromDataAnnotation
bool
Returns
SetTablespace(IMutableModel, string?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public static void SetTablespace(this IMutableModel model, string? tablespace)
Parameters
model
IMutableModeltablespace
string
SetValueGenerationStrategy(IConventionModel, NpgsqlValueGenerationStrategy?, bool)
Attempts to set the NpgsqlValueGenerationStrategy to use for properties of keys in the model that don't have a strategy explicitly set.
public static NpgsqlValueGenerationStrategy? SetValueGenerationStrategy(this IConventionModel model, NpgsqlValueGenerationStrategy? value, bool fromDataAnnotation = false)
Parameters
model
IConventionModelThe model.
value
NpgsqlValueGenerationStrategy?The value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
SetValueGenerationStrategy(IMutableModel, NpgsqlValueGenerationStrategy?)
Attempts to set the NpgsqlValueGenerationStrategy to use for properties of keys in the model that don't have a strategy explicitly set.
public static void SetValueGenerationStrategy(this IMutableModel model, NpgsqlValueGenerationStrategy? value)
Parameters
model
IMutableModelThe model.
value
NpgsqlValueGenerationStrategy?The value to set.