Share via


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)

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string name);
static member ToJsonProperty : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function ToJsonProperty (propertyBuilder As PropertyBuilder, name As String) As PropertyBuilder

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

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.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string name, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? ToJsonProperty (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? name, bool fromDataAnnotation = false);
static member ToJsonProperty : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function ToJsonProperty (propertyBuilder As IConventionPropertyBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

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

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

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> ToJsonProperty<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string name);
static member ToJsonProperty : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function ToJsonProperty(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty), name As String) As PropertyBuilder(Of TProperty)

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