Share via


DbSet<TEntity>.Create Method

Definition

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

TEntity

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

TDerivedEntity

The entity instance, which may be a proxy.

Implements

Applies to