Class RelationalPropertyExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Extension methods for Microsoft.EntityFrameworkCore.Metadata.IProperty for relational database metadata.
public static class RelationalPropertyExtensions
- Inheritance
-
RelationalPropertyExtensions
- Inherited Members
Methods
FindColumn(IProperty, in StoreObjectIdentifier)
Returns the column corresponding to this property if it's mapped to the given table-like store object.
public static IColumnBase FindColumn(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IColumnBase
The column to which the property is mapped.
FindOverrides(IProperty, in StoreObjectIdentifier)
Returns the property facet overrides for a particular table-like store object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IAnnotatable FindOverrides(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IAnnotatable
An object that stores property facet overrides.
FindRelationalMapping(IProperty)
Returns the RelationalTypeMapping for the given property on a finalized model.
[Obsolete("Use FindRelationalTypeMapping")]
public static RelationalTypeMapping FindRelationalMapping(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- RelationalTypeMapping
The type mapping, or null if none was found.
FindRelationalTypeMapping(IProperty)
Returns the RelationalTypeMapping for the given property on a finalized model.
public static RelationalTypeMapping FindRelationalTypeMapping(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- RelationalTypeMapping
The type mapping, or null if none was found.
FindRelationalTypeMapping(IProperty, in StoreObjectIdentifier)
Returns the RelationalTypeMapping for the given property on a finalized model.
public static RelationalTypeMapping FindRelationalTypeMapping(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- RelationalTypeMapping
The type mapping, or null if none was found.
FindSharedStoreObjectRootProperty(IConventionProperty, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IProperty that is mapped to the same column in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IConventionProperty FindSharedStoreObjectRootProperty(this IConventionProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IConventionPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IConventionProperty
The property found, or null if none was found.
FindSharedStoreObjectRootProperty(IMutableProperty, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IProperty that is mapped to the same column in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IMutableProperty FindSharedStoreObjectRootProperty(this IMutableProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IMutablePropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IMutableProperty
The property found, or null if none was found.
FindSharedStoreObjectRootProperty(IProperty, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IProperty that is mapped to the same column in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IProperty FindSharedStoreObjectRootProperty(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IProperty
The property found, or null if none was found.
GetCollation(IProperty)
Returns the collation to be used for the column.
public static string GetCollation(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The collation for the column this property is mapped to.
GetCollation(IProperty, in StoreObjectIdentifier)
Returns the collation to be used for the column.
public static string GetCollation(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The collation for the column this property is mapped to.
GetCollationConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column collation.
public static ConfigurationSource? GetCollationConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column collation.
GetColumnBaseName(IProperty)
Returns the base name of the column to which the property would be mapped.
public static string GetColumnBaseName(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The the base name of the column to which the property would be mapped.
GetColumnName(IProperty)
Returns the name of the table column to which the property is mapped.
[Obsolete("Use the overload that takes a StoreObjectIdentifier")]
public static string GetColumnName(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The name of the table column to which the property is mapped.
GetColumnName(IProperty, in StoreObjectIdentifier)
Returns the name of the column to which the property is mapped for a particular table.
public static string GetColumnName(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The name of the column to which the property is mapped.
GetColumnNameConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name.
public static ConfigurationSource? GetColumnNameConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name.
GetColumnNameConfigurationSource(IConventionProperty, in StoreObjectIdentifier)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name for a particular table-like store object.
public static ConfigurationSource? GetColumnNameConfigurationSource(this IConventionProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IConventionPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name for a particular table-like store object.
GetColumnType(IProperty)
Returns the database type of the column to which the property is mapped.
public static string GetColumnType(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The database type of the column to which the property is mapped.
GetColumnType(IProperty, in StoreObjectIdentifier)
Returns the database type of the column to which the property is mapped.
public static string GetColumnType(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The database type of the column to which the property is mapped.
GetColumnTypeConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name.
public static ConfigurationSource? GetColumnTypeConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column name.
GetComment(IProperty)
Returns the comment for the column this property is mapped to.
public static string GetComment(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The comment for the column this property is mapped to.
GetComment(IProperty, in StoreObjectIdentifier)
Returns the comment for the column this property is mapped to.
public static string GetComment(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The comment for the column this property is mapped to.
GetCommentConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column comment.
public static ConfigurationSource? GetCommentConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the column comment.
GetComputedColumnSql(IProperty)
Returns the SQL expression that is used as the computed value for the column this property is mapped to.
public static string GetComputedColumnSql(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The SQL expression that is used as the computed value for the column this property is mapped to.
GetComputedColumnSql(IProperty, in StoreObjectIdentifier)
Returns the SQL expression that is used as the computed value for the column this property is mapped to.
public static string GetComputedColumnSql(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The SQL expression that is used as the computed value for the column this property is mapped to.
GetComputedColumnSqlConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the computed value SQL expression.
public static ConfigurationSource? GetComputedColumnSqlConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the computed value SQL expression.
GetDefaultColumnBaseName(IProperty)
Returns the default base name of the column to which the property would be mapped
public static string GetDefaultColumnBaseName(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The default base column name to which the property would be mapped.
GetDefaultColumnMappings(IProperty)
Returns the default columns to which the property would be mapped.
public static IEnumerable<IColumnMappingBase> GetDefaultColumnMappings(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- IEnumerable<IColumnMappingBase>
The default columns to which the property would be mapped.
GetDefaultColumnName(IProperty)
Returns the default table column name to which the property would be mapped.
[Obsolete("Use the overload that takes a StoreObjectIdentifier")]
public static string GetDefaultColumnName(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The default table column name to which the property would be mapped.
GetDefaultColumnName(IProperty, in StoreObjectIdentifier)
Returns the default column name to which the property would be mapped.
public static string GetDefaultColumnName(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The default column name to which the property would be mapped.
GetDefaultValue(IProperty)
Returns the object that is used as the default value for the column this property is mapped to.
public static object GetDefaultValue(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- object
The object that is used as the default value for the column this property is mapped to.
GetDefaultValue(IProperty, in StoreObjectIdentifier)
Returns the object that is used as the default value for the column this property is mapped to.
public static object GetDefaultValue(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- object
The object that is used as the default value for the column this property is mapped to.
GetDefaultValueConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the default value.
public static ConfigurationSource? GetDefaultValueConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the default value.
GetDefaultValueSql(IProperty)
Returns the SQL expression that is used as the default value for the column this property is mapped to.
public static string GetDefaultValueSql(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- string
The SQL expression that is used as the default value for the column this property is mapped to.
GetDefaultValueSql(IProperty, in StoreObjectIdentifier)
Returns the SQL expression that is used as the default value for the column this property is mapped to.
public static string GetDefaultValueSql(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- string
The SQL expression that is used as the default value for the column this property is mapped to.
GetDefaultValueSqlConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the default value SQL expression.
public static ConfigurationSource? GetDefaultValueSqlConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the default value SQL expression.
GetFunctionColumnMappings(IProperty)
Returns the function columns to which the property is mapped.
public static IEnumerable<IFunctionColumnMapping> GetFunctionColumnMappings(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- IEnumerable<IFunctionColumnMapping>
The function columns to which the property is mapped.
GetIsFixedLengthConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for IsFixedLength(IProperty).
public static ConfigurationSource? GetIsFixedLengthConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for IsFixedLength(IProperty).
GetIsStored(IProperty)
Gets whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
public static bool? GetIsStored(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- bool?
Whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
GetIsStored(IProperty, in StoreObjectIdentifier)
Gets whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
public static bool? GetIsStored(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- bool?
Whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
GetIsStoredConfigurationSource(IConventionProperty)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the computed value SQL expression.
public static ConfigurationSource? GetIsStoredConfigurationSource(this IConventionProperty property)
Parameters
property
IConventionPropertyThe property.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the computed value SQL expression.
GetMaxLength(IProperty, in StoreObjectIdentifier)
Gets the maximum length of data that is allowed in this property. For example, if the property is a string then this is the maximum number of characters.
public static int? GetMaxLength(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
GetOrCreateOverrides(IConventionProperty, in StoreObjectIdentifier)
Returns the property facet overrides for a particular table-like store object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IConventionAnnotatable GetOrCreateOverrides(this IConventionProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IConventionPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IConventionAnnotatable
An object that stores property facet overrides.
GetOrCreateOverrides(IMutableProperty, in StoreObjectIdentifier)
Returns the property facet overrides for a particular table-like store object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IMutableAnnotatable GetOrCreateOverrides(this IMutableProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IMutablePropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- IMutableAnnotatable
An object that stores property facet overrides.
GetPrecision(IProperty, in StoreObjectIdentifier)
Gets the precision of data that is allowed in this property. For example, if the property is a decimal then this is the maximum number of digits.
public static int? GetPrecision(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
GetRelationalTypeMapping(IProperty)
Returns the RelationalTypeMapping for the given property on a finalized model.
public static RelationalTypeMapping GetRelationalTypeMapping(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- RelationalTypeMapping
The type mapping.
GetScale(IProperty, in StoreObjectIdentifier)
Gets the scale of data that is allowed in this property. For example, if the property is a decimal then this is the maximum number of decimal places.
public static int? GetScale(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
GetSqlQueryColumnMappings(IProperty)
Returns the SQL query columns to which the property is mapped.
public static IEnumerable<ISqlQueryColumnMapping> GetSqlQueryColumnMappings(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- IEnumerable<ISqlQueryColumnMapping>
The SQL query columns to which the property is mapped.
GetTableColumnMappings(IProperty)
Returns the table columns to which the property is mapped.
public static IEnumerable<IColumnMapping> GetTableColumnMappings(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- IEnumerable<IColumnMapping>
The table columns to which the property is mapped.
GetViewColumnMappings(IProperty)
Returns the view columns to which the property is mapped.
public static IEnumerable<IViewColumnMapping> GetViewColumnMappings(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- IEnumerable<IViewColumnMapping>
The view columns to which the property is mapped.
IsColumnNullable(IProperty)
Checks whether the column mapped to the given Microsoft.EntityFrameworkCore.Metadata.IProperty will be nullable when created in the database.
This depends on the property itself and also how it is mapped. For example, derived non-nullable properties in a TPH type hierarchy will be mapped to nullable columns. As well as properties on optional types sharing the same table.
public static bool IsColumnNullable(this IProperty property)
Parameters
property
IPropertyThe Microsoft.EntityFrameworkCore.Metadata.IProperty.
Returns
IsColumnNullable(IProperty, in StoreObjectIdentifier)
Checks whether the column mapped to the given Microsoft.EntityFrameworkCore.Metadata.IProperty will be nullable when created in the database.
This depends on the property itself and also how it is mapped. For example, derived non-nullable properties in a TPH type hierarchy will be mapped to nullable columns. As well as properties on optional types sharing the same table.
public static bool IsColumnNullable(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe Microsoft.EntityFrameworkCore.Metadata.IProperty.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
IsFixedLength(IProperty)
Returns a flag indicating if the property as capable of storing only fixed-length data, such as strings.
public static bool? IsFixedLength(this IProperty property)
Parameters
property
IPropertyThe property.
Returns
- bool?
A flag indicating if the property as capable of storing only fixed-length data, such as strings.
IsFixedLength(IProperty, in StoreObjectIdentifier)
Returns a flag indicating if the property as capable of storing only fixed-length data, such as strings.
public static bool? IsFixedLength(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
- bool?
A flag indicating if the property as capable of storing only fixed-length data, such as strings.
IsUnicode(IProperty, in StoreObjectIdentifier)
Gets a value indicating whether or not the property can persist Unicode characters.
public static bool? IsUnicode(this IProperty property, in StoreObjectIdentifier storeObject)
Parameters
property
IPropertyThe property.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
Returns
SetCollation(IConventionProperty, string, bool)
Configures a collation to be used for the column this property is mapped to.
public static string SetCollation(this IConventionProperty property, string collation, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
collation
stringThe collation for the column.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetCollation(IMutableProperty, string)
Configures a collation to be used for column this property is mapped to.
public static void SetCollation(this IMutableProperty property, string collation)
Parameters
property
IMutablePropertyThe property.
collation
stringThe collation for the column.
SetColumnName(IConventionProperty, string, in StoreObjectIdentifier, bool)
Sets the column to which the property is mapped for a particular table-like store object.
public static string SetColumnName(this IConventionProperty property, string name, in StoreObjectIdentifier storeObject, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
name
stringThe name to set.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetColumnName(IConventionProperty, string, bool)
Sets the column to which the property is mapped.
public static string SetColumnName(this IConventionProperty property, string name, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
name
stringThe name to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetColumnName(IMutableProperty, string)
Sets the column to which the property is mapped.
public static void SetColumnName(this IMutableProperty property, string name)
Parameters
property
IMutablePropertyThe property.
name
stringThe name to set.
SetColumnName(IMutableProperty, string, in StoreObjectIdentifier)
Sets the column to which the property is mapped for a particular table-like store object.
public static void SetColumnName(this IMutableProperty property, string name, in StoreObjectIdentifier storeObject)
Parameters
property
IMutablePropertyThe property.
name
stringThe name to set.
storeObject
StoreObjectIdentifierThe identifier of the table-like store object containing the column.
SetColumnType(IConventionProperty, string, bool)
Sets the database type of the column to which the property is mapped.
public static string SetColumnType(this IConventionProperty property, string value, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetColumnType(IMutableProperty, string)
Sets the database type of the column to which the property is mapped.
public static void SetColumnType(this IMutableProperty property, string value)
Parameters
property
IMutablePropertyThe property.
value
stringThe value to set.
SetComment(IConventionProperty, string, bool)
Configures a comment to be applied to the column this property is mapped to.
public static string SetComment(this IConventionProperty property, string comment, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
comment
stringThe comment for the column.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetComment(IMutableProperty, string)
Configures a comment to be applied to the column this property is mapped to.
public static void SetComment(this IMutableProperty property, string comment)
Parameters
property
IMutablePropertyThe property.
comment
stringThe comment for the column.
SetComputedColumnSql(IConventionProperty, string, bool)
Sets the SQL expression that is used as the computed value for the column this property is mapped to.
public static string SetComputedColumnSql(this IConventionProperty property, string value, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetComputedColumnSql(IMutableProperty, string)
Sets the SQL expression that is used as the computed value for the column this property is mapped to.
public static void SetComputedColumnSql(this IMutableProperty property, string value)
Parameters
property
IMutablePropertyThe property.
value
stringThe value to set.
SetDefaultValue(IConventionProperty, object, bool)
Sets the object that is used as the default value for the column this property is mapped to.
public static object SetDefaultValue(this IConventionProperty property, object value, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
value
objectThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- object
The configured value.
SetDefaultValue(IMutableProperty, object)
Sets the object that is used as the default value for the column this property is mapped to.
public static void SetDefaultValue(this IMutableProperty property, object value)
Parameters
property
IMutablePropertyThe property.
value
objectThe value to set.
SetDefaultValueSql(IConventionProperty, string, bool)
Sets the SQL expression that is used as the default value for the column this property is mapped to.
public static string SetDefaultValueSql(this IConventionProperty property, string value, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetDefaultValueSql(IMutableProperty, string)
Sets the SQL expression that is used as the default value for the column this property is mapped to.
public static void SetDefaultValueSql(this IMutableProperty property, string value)
Parameters
property
IMutablePropertyThe property.
value
stringThe value to set.
SetIsFixedLength(IConventionProperty, bool?, bool)
Sets a flag indicating whether the property as capable of storing only fixed-length data, such as strings.
public static bool? SetIsFixedLength(this IConventionProperty property, bool? fixedLength, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
fixedLength
bool?A value indicating whether the property is constrained to fixed length values.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- bool?
The configured value.
SetIsFixedLength(IMutableProperty, bool?)
Sets a flag indicating whether the property as capable of storing only fixed-length data, such as strings.
public static void SetIsFixedLength(this IMutableProperty property, bool? fixedLength)
Parameters
property
IMutablePropertyThe property.
fixedLength
bool?A value indicating whether the property is constrained to fixed length values.
SetIsStored(IConventionProperty, bool?, bool)
Sets whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
public static bool? SetIsStored(this IConventionProperty property, bool? value, bool fromDataAnnotation = false)
Parameters
property
IConventionPropertyThe property.
value
bool?The value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- bool?
The configured value.
SetIsStored(IMutableProperty, bool?)
Sets whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.
public static void SetIsStored(this IMutableProperty property, bool? value)
Parameters
property
IMutablePropertyThe property.
value
bool?The value to set.