Class RelationalOwnedNavigationBuilderExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Relational database specific extension methods for Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder.
public static class RelationalOwnedNavigationBuilderExtensions
- Inheritance
-
RelationalOwnedNavigationBuilderExtensions
- Inherited Members
Remarks
See Modeling entity types and relationships for more information and examples.
Methods
HasJsonPropertyName(OwnedNavigationBuilder, string?)
Configures the navigation of an entity mapped to a JSON column, mapping the navigation to a specific JSON property, rather than using the navigation name.
public static OwnedNavigationBuilder HasJsonPropertyName(this OwnedNavigationBuilder navigationBuilder, string? name)
Parameters
navigationBuilderOwnedNavigationBuilderThe builder for the navigation being configured.
namestringJSON property name to be used.
Returns
- OwnedNavigationBuilder
The same builder instance so that multiple calls can be chained.
HasJsonPropertyName<TSource, TTarget>(OwnedNavigationBuilder<TSource, TTarget>, string?)
Configures the navigation of an entity mapped to a JSON column, mapping the navigation to a specific JSON property, rather than using the navigation name.
public static OwnedNavigationBuilder<TSource, TTarget> HasJsonPropertyName<TSource, TTarget>(this OwnedNavigationBuilder<TSource, TTarget> navigationBuilder, string? name) where TSource : class where TTarget : class
Parameters
navigationBuilderOwnedNavigationBuilder<TSource, TTarget>The builder for the navigation being configured.
namestringJSON property name to be used.
Returns
- OwnedNavigationBuilder<TSource, TTarget>
The same builder instance so that multiple calls can be chained.
Type Parameters
TSourceTTarget
ToJson(OwnedNavigationBuilder)
Configures a relationship where this entity type and the entities that it owns are mapped to a JSON column in the database.
public static OwnedNavigationBuilder ToJson(this OwnedNavigationBuilder builder)
Parameters
builderOwnedNavigationBuilderThe builder for the owned navigation being configured.
Returns
- OwnedNavigationBuilder
The same builder instance so that multiple calls can be chained.
Remarks
This method should only be specified for the outer-most owned entity in the given ownership structure. All entities owned by this will be automatically mapped to the same JSON column. The ownerships must still be explicitly defined. Name of the navigation will be used as the JSON column name.
ToJson(OwnedNavigationBuilder, string?)
Configures a relationship where this entity type and the entities that it owns are mapped to a JSON column in the database.
public static OwnedNavigationBuilder ToJson(this OwnedNavigationBuilder builder, string? jsonColumnName)
Parameters
builderOwnedNavigationBuilderThe builder for the owned navigation being configured.
jsonColumnNamestringJSON column name to use.
Returns
- OwnedNavigationBuilder
The same builder instance so that multiple calls can be chained.
Remarks
This method should only be specified for the outer-most owned entity in the given ownership structure. All entities owned by this will be automatically mapped to the same JSON column. The ownerships must still be explicitly defined.
ToJson<TOwnerEntity, TDependentEntity>(OwnedNavigationBuilder<TOwnerEntity, TDependentEntity>)
Configures a relationship where this entity type and the entities that it owns are mapped to a JSON column in the database.
public static OwnedNavigationBuilder<TOwnerEntity, TDependentEntity> ToJson<TOwnerEntity, TDependentEntity>(this OwnedNavigationBuilder<TOwnerEntity, TDependentEntity> builder) where TOwnerEntity : class where TDependentEntity : class
Parameters
builderOwnedNavigationBuilder<TOwnerEntity, TDependentEntity>The builder for the owned navigation being configured.
Returns
- OwnedNavigationBuilder<TOwnerEntity, TDependentEntity>
The same builder instance so that multiple calls can be chained.
Type Parameters
TOwnerEntityTDependentEntity
Remarks
This method should only be specified for the outer-most owned entity in the given ownership structure. All entities owned by this will be automatically mapped to the same JSON column. The ownerships must still be explicitly defined. Name of the navigation will be used as the JSON column name.
ToJson<TOwnerEntity, TDependentEntity>(OwnedNavigationBuilder<TOwnerEntity, TDependentEntity>, string?)
Configures a relationship where this entity type and the entities that it owns are mapped to a JSON column in the database.
public static OwnedNavigationBuilder<TOwnerEntity, TDependentEntity> ToJson<TOwnerEntity, TDependentEntity>(this OwnedNavigationBuilder<TOwnerEntity, TDependentEntity> builder, string? jsonColumnName) where TOwnerEntity : class where TDependentEntity : class
Parameters
builderOwnedNavigationBuilder<TOwnerEntity, TDependentEntity>The builder for the owned navigation being configured.
jsonColumnNamestringJSON column name to use.
Returns
- OwnedNavigationBuilder<TOwnerEntity, TDependentEntity>
The same builder instance so that multiple calls can be chained.
Type Parameters
TOwnerEntityTDependentEntity
Remarks
This method should only be specified for the outer-most owned entity in the given ownership structure. All entities owned by this will be automatically mapped to the same JSON column. The ownerships must still be explicitly defined.