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.

C#
public static void SetHasShadowIds (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, bool? alwaysCreate);

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

Entity Framework Core 9.0
Product Versions
Entity Framework Core 9.0

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.

C#
public static bool? SetHasShadowIds (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, bool? alwaysCreate, bool fromDataAnnotation = false);

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

Entity Framework Core 9.0
Product Versions
Entity Framework Core 9.0