Share via


CosmosEntityTypeExtensions.SetHasShadowId Method

Definition

Overloads

Name Description
SetHasShadowId(IMutableEntityType, Nullable<Boolean>)

Forces model building to always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

SetHasShadowId(IConventionEntityType, Nullable<Boolean>, Boolean)

Forces model building to always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

SetHasShadowId(IMutableEntityType, Nullable<Boolean>)

Source:
CosmosEntityTypeExtensions.cs
Source:
CosmosEntityTypeExtensions.cs

Forces model building to always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

public static void SetHasShadowId(this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, bool? alwaysCreate);
static member SetHasShadowId : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Nullable<bool> -> unit
<Extension()>
Public Sub SetHasShadowId (entityType As IMutableEntityType, alwaysCreate As Nullable(Of Boolean))

Parameters

entityType
IMutableEntityType

The entity type.

alwaysCreate
Nullable<Boolean>

true to force __id creation, false to not force __id creation, null to revert to the default setting.

Applies to

SetHasShadowId(IConventionEntityType, Nullable<Boolean>, Boolean)

Source:
CosmosEntityTypeExtensions.cs
Source:
CosmosEntityTypeExtensions.cs

Forces model building to always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

public static bool? SetHasShadowId(this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, bool? alwaysCreate, bool fromDataAnnotation = false);
static member SetHasShadowId : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Nullable<bool> * bool -> Nullable<bool>
<Extension()>
Public Function SetHasShadowId (entityType As IConventionEntityType, alwaysCreate As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As Nullable(Of Boolean)

Parameters

entityType
IConventionEntityType

The entity type.

alwaysCreate
Nullable<Boolean>

true to force __id creation, false to not force __id creation, null to revert to the default setting.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

Applies to