DbSet<TEntity>.Create 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
Create() |
Creates a new instance of an entity for the type of this set. Note that this instance is NOT added or attached to the set. The instance returned will be a proxy if the underlying context is configured to create proxies and the entity type meets the requirements for creating a proxy. |
Create<TDerivedEntity>() |
Creates a new instance of an entity for the type of this set or for a type derived from the type of this set. Note that this instance is NOT added or attached to the set. The instance returned will be a proxy if the underlying context is configured to create proxies and the entity type meets the requirements for creating a proxy. |
Create()
Creates a new instance of an entity for the type of this set. Note that this instance is NOT added or attached to the set. The instance returned will be a proxy if the underlying context is configured to create proxies and the entity type meets the requirements for creating a proxy.
public virtual TEntity Create ();
abstract member Create : unit -> 'Entity
override this.Create : unit -> 'Entity
Public Overridable Function Create () As TEntity
Returns
The entity instance, which may be a proxy.
Implements
Applies to
Create<TDerivedEntity>()
Creates a new instance of an entity for the type of this set or for a type derived from the type of this set. Note that this instance is NOT added or attached to the set. The instance returned will be a proxy if the underlying context is configured to create proxies and the entity type meets the requirements for creating a proxy.
public virtual TDerivedEntity Create<TDerivedEntity> () where TDerivedEntity : class, TEntity;
abstract member Create : unit -> 'DerivedEntity
override this.Create : unit -> 'DerivedEntity
Public Overridable Function Create(Of TDerivedEntity As {Class, TEntity}) () As TDerivedEntity
Type Parameters
- TDerivedEntity
The type of entity to create.
Returns
The entity instance, which may be a proxy.
Implements
Applies to
Entity Framework