Udostępnij za pośrednictwem


CosmosModelExtensions.SetHasShadowIds Method

Definition

Overloads

SetHasShadowIds(IMutableModel, 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.

SetHasShadowIds(IConventionModel, 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.

SetHasShadowIds(IMutableModel, Nullable<Boolean>)

Source:
CosmosModelExtensions.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 SetHasShadowIds (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, bool? alwaysCreate);
static member SetHasShadowIds : Microsoft.EntityFrameworkCore.Metadata.IMutableModel * Nullable<bool> -> unit
<Extension()>
Public Sub SetHasShadowIds (model As IMutableModel, alwaysCreate As Nullable(Of Boolean))

Parameters

model
IMutableModel

The model.

alwaysCreate
Nullable<Boolean>

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

Applies to

SetHasShadowIds(IConventionModel, Nullable<Boolean>, Boolean)

Source:
CosmosModelExtensions.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? SetHasShadowIds (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, bool? alwaysCreate, bool fromDataAnnotation = false);
static member SetHasShadowIds : Microsoft.EntityFrameworkCore.Metadata.IConventionModel * Nullable<bool> * bool -> Nullable<bool>
<Extension()>
Public Function SetHasShadowIds (model As IConventionModel, alwaysCreate As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As Nullable(Of Boolean)

Parameters

model
IConventionModel

The model.

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