RelationalPropertyExtensions.TryGetDefaultValue Method

Definition

Overloads

TryGetDefaultValue(IReadOnlyProperty, Object)

Returns the object that is used as the default value for the column this property is mapped to.

TryGetDefaultValue(IReadOnlyProperty, StoreObjectIdentifier, Object)

Returns the object that is used as the default value for the column this property is mapped to.

TryGetDefaultValue(IReadOnlyProperty, Object)

Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs

Returns the object that is used as the default value for the column this property is mapped to.

C#
public static bool TryGetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, out object? defaultValue);

Parameters

property
IReadOnlyProperty

The property.

defaultValue
Object

The default value, or the CLR default if no explicit default has been set.

Returns

true if a default value has been explicitly set; false otherwise.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0

TryGetDefaultValue(IReadOnlyProperty, StoreObjectIdentifier, Object)

Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs

Returns the object that is used as the default value for the column this property is mapped to.

C#
public static bool TryGetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier storeObject, out object? defaultValue);

Parameters

property
IReadOnlyProperty

The property.

storeObject
StoreObjectIdentifier

The identifier of the table-like store object containing the column.

defaultValue
Object

The default value, or the CLR default if no explicit default has been set.

Returns

true if a default value has been explicitly set; false otherwise.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0