IMutableModel.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) |
Adds an owned entity type of default type to the model. |
AddOwnedEntityType(Type) |
Adds an owned entity type to the model. |
AddOwnedEntityType(String, Type) |
Adds an owned shared type entity type to the model. |
AddOwnedEntityType(String)
Adds an owned entity type of default type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (string name);
abstract member AddOwnedEntityType : string -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (name As String) As IMutableEntityType
Parameters
- name
- String
The name of the entity to be added.
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
AddOwnedEntityType(Type)
Adds an owned entity type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (Type type);
abstract member AddOwnedEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (type As Type) As IMutableEntityType
Parameters
- type
- Type
The CLR class that is used to represent instances of the entity type.
Returns
The new entity type.
Applies to
AddOwnedEntityType(String, Type)
Adds an owned shared type entity type to the model.
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddOwnedEntityType (string name, Type type);
abstract member AddOwnedEntityType : string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddOwnedEntityType (name As String, type As Type) As IMutableEntityType
Parameters
- name
- String
The name of the entity to be added.
- type
- Type
The CLR class that is used to represent instances of the entity type.
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
Entity Framework