Share via


DbSet.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(Type)

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 object Create ();
abstract member Create : unit -> obj
override this.Create : unit -> obj
Public Overridable Function Create () As Object

Returns

The entity instance, which may be a proxy.

Applies to

Create(Type)

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 object Create (Type derivedEntityType);
abstract member Create : Type -> obj
override this.Create : Type -> obj
Public Overridable Function Create (derivedEntityType As Type) As Object

Parameters

derivedEntityType
Type

The type of entity to create.

Returns

The entity instance, which may be a proxy.

Applies to