CosmosPropertyBuilderExtensions.ToJsonProperty Method

Definition

Overloads

ToJsonProperty(PropertyBuilder, String)

Configures the property name that the property is mapped to when targeting Azure Cosmos.

ToJsonProperty(IConventionPropertyBuilder, String, Boolean)

Configures the property name that the property is mapped to when targeting Azure Cosmos. If an empty string is supplied then the property will not be persisted.

ToJsonProperty<TProperty>(PropertyBuilder<TProperty>, String)

Configures the property name that the property is mapped to when targeting Azure Cosmos.

ToJsonProperty(PropertyBuilder, String)

Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs

Configures the property name that the property is mapped to when targeting Azure Cosmos.

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string name);

Parameters

propertyBuilder
PropertyBuilder

The builder for the property being configured.

name
String

The name of the property.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

If an empty string is supplied, the property will not be persisted.

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to

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

ToJsonProperty(IConventionPropertyBuilder, String, Boolean)

Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs

Configures the property name that the property is mapped to when targeting Azure Cosmos. If an empty string is supplied then the property will not be persisted.

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string name, bool fromDataAnnotation = false);
C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? name, bool fromDataAnnotation = false);

Parameters

propertyBuilder
IConventionPropertyBuilder

The builder for the property being configured.

name
String

The name of the property.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to

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

ToJsonProperty<TProperty>(PropertyBuilder<TProperty>, String)

Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs
Source:
CosmosPropertyBuilderExtensions.cs

Configures the property name that the property is mapped to when targeting Azure Cosmos.

C#
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> ToJsonProperty<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string name);

Type Parameters

TProperty

The type of the property being configured.

Parameters

propertyBuilder
PropertyBuilder<TProperty>

The builder for the property being configured.

name
String

The name of the property.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to

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