OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.OwnsOne Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OwnsOne(String, String, Action<OwnedNavigationBuilder>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne(Type, String, Action<OwnedNavigationBuilder>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String, String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String, String) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity,TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(String) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity,TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>) |
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to. |
OwnsOne(String, String, Action<OwnedNavigationBuilder>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
- buildAction
- Action<OwnedNavigationBuilder>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne(Type, String, Action<OwnedNavigationBuilder>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Parameters
- ownedType
- Type
The entity type that this relationship targets.
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
- buildAction
- Action<OwnedNavigationBuilder>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne(String, Type, String, Action<OwnedNavigationBuilder>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne (string ownedTypeName, Type ownedType, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> buildAction);
override this.OwnsOne : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
override this.OwnsOne : string * Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
Public Overridable Function OwnsOne (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne (ownedTypeName As String, ownedType As Type, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder)) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- ownedType
- Type
The CLR type of the entity type that this relationship targets.
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
- buildAction
- Action<OwnedNavigationBuilder>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String, String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- navigationExpression
- Expression<Func<TDependentEntity,TNewDependentEntity>>
A lambda expression representing the reference navigation property on this entity type that represents
the relationship (customer => customer.Address
).
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String, String)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, string navigationName) where TNewDependentEntity : class;
override this.OwnsOne : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String, Expression<Func<TDependentEntity,TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string ownedTypeName, System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsOne : string * System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (ownedTypeName As String, navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- ownedTypeName
- String
The name of the entity type that this relationship targets.
- navigationExpression
- Expression<Func<TDependentEntity,TNewDependentEntity>>
A lambda expression representing the reference navigation property on this entity type that represents
the relationship (customer => customer.Address
).
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String, Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String, buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(String)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (string navigationName) where TNewDependentEntity : class;
override this.OwnsOne : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationName As String) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- navigationName
- String
The name of the reference navigation property on this entity type that represents the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity,TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression) where TNewDependentEntity : class;
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity (requires 'DependentEntity : null and 'NewDependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- navigationExpression
- Expression<Func<TDependentEntity,TNewDependentEntity>>
A lambda expression representing the reference navigation property on this entity type that represents
the relationship (customer => customer.Address
).
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
OwnsOne<TNewDependentEntity>(Expression<Func<TDependentEntity, TNewDependentEntity>>, Action<OwnedNavigationBuilder<TDependentEntity, TNewDependentEntity>>)
Configures a relationship where the target entity is owned by (or part of) this entity. The target entity key value is always propagated from the entity it belongs to.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> OwnsOne<TNewDependentEntity> (System.Linq.Expressions.Expression<Func<TDependentEntity,TNewDependentEntity?>> navigationExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>> buildAction) where TNewDependentEntity : class;
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
override this.OwnsOne : System.Linq.Expressions.Expression<Func<'DependentEntity, 'NewDependentEntity>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'DependentEntity, 'NewDependentEntity>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)> (requires 'NewDependentEntity : null)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)
Public Overridable Function OwnsOne(Of TNewDependentEntity As Class) (navigationExpression As Expression(Of Func(Of TDependentEntity, TNewDependentEntity)), buildAction As Action(Of OwnedNavigationBuilder(Of TDependentEntity, TNewDependentEntity))) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Type Parameters
- TNewDependentEntity
The entity type that this relationship targets.
Parameters
- navigationExpression
- Expression<Func<TDependentEntity,TNewDependentEntity>>
A lambda expression representing the reference navigation property on this entity type that represents
the relationship (customer => customer.Address
).
- buildAction
- Action<OwnedNavigationBuilder<TDependentEntity,TNewDependentEntity>>
An action that performs configuration of the relationship.
Returns
An object that can be used to configure the entity type.
Remarks
The target entity type for each ownership relationship is treated as a different entity type even if the navigation is of the same type. Configuration of the target entity type isn't applied to the target entity type of other ownership relationships.
Most operations on an owned entity require accessing it through the owner entity using the corresponding navigation.
After calling this method, you should chain a call to WithOwner to fully configure the relationship.
Applies to
Entity Framework