Share via


IDbSet<TEntity>.Create<TDerivedEntity> Method

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

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.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

Syntax

'Declaration
Function Create(Of TDerivedEntity As {Class, TEntity}) As TDerivedEntity
'Usage
Dim instance As IDbSet 
Dim returnValue As TDerivedEntity

returnValue = instance.Create()
TDerivedEntity Create<TDerivedEntity>()
where TDerivedEntity : class, TEntity
generic<typename TDerivedEntity>
where TDerivedEntity : ref class, TEntity
TDerivedEntity Create()
abstract Create : unit -> 'TDerivedEntity  when 'TDerivedEntity : not struct and 'TEntity
JScript does not support generic types and methods.

Type Parameters

  • TDerivedEntity
    The type of entity to create.

Return Value

Type: TDerivedEntity
The entity instance, which may be a proxy.

See Also

Reference

IDbSet<TEntity> Interface

Create Overload

System.Data.Entity Namespace