RelationalPropertyExtensions.TryGetDefaultValue Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
Returns the object that is used as the default value for the column this property is mapped to.
public static bool TryGetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, out object? defaultValue);
static member TryGetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * obj -> bool
<Extension()>
Public Function TryGetDefaultValue (property As IReadOnlyProperty, ByRef defaultValue As Object) As Boolean
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 |
Returns the object that is used as the default value for the column this property is mapped to.
public static bool TryGetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier storeObject, out object? defaultValue);
static member TryGetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * StoreObjectIdentifier * obj -> bool
<Extension()>
Public Function TryGetDefaultValue (property As IReadOnlyProperty, ByRef storeObject As StoreObjectIdentifier, ByRef defaultValue As Object) As Boolean
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 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: