IConventionModel.AddOwnedEntityType 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
AddOwnedEntityType(String, Type, Boolean) |
Adds an owned shared type entity type to the model. |
AddOwnedEntityType(Type, Boolean) |
Adds an owned entity type to the model. |
AddOwnedEntityType(String, Boolean) |
Adds an owned entity type of default type to the model. |
AddOwnedEntityType(String, Type, Boolean)
Adds an owned shared type entity type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType? AddOwnedEntityType (string name, Type clrType, bool fromDataAnnotation = false);
abstract member AddOwnedEntityType : string * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType
Public Function AddOwnedEntityType (name As String, clrType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionEntityType
Parameters
- name
- String
The name of the entity to be added.
- clrType
- Type
The CLR class that is used to represent instances of the entity type.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The new entity type.
Remarks
Shared type entity type is an entity type which can share CLR type with other types in the model but has a unique name and always identified by the name.
Applies to
AddOwnedEntityType(Type, Boolean)
Adds an owned entity type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType? AddOwnedEntityType (Type type, bool fromDataAnnotation = false);
abstract member AddOwnedEntityType : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType
Public Function AddOwnedEntityType (type As Type, Optional fromDataAnnotation As Boolean = false) As IConventionEntityType
Parameters
- type
- Type
The CLR class that is used to represent instances of the entity type.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The new entity type.
Applies to
AddOwnedEntityType(String, Boolean)
Adds an owned entity type of default type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType? AddOwnedEntityType (string name, bool fromDataAnnotation = false);
abstract member AddOwnedEntityType : string * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType
Public Function AddOwnedEntityType (name As String, Optional fromDataAnnotation As Boolean = false) As IConventionEntityType
Parameters
- name
- String
The name of the entity to be added.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The new entity type.
Remarks
Shadow entities are not currently supported in a model that is used at runtime with a DbContext. Therefore, shadow state entity types will only exist in migration model snapshots, etc.
Applies to
Entity Framework