DbContext.Set Method

Definition

Overloads

Set<TEntity>()

Creates a DbSet<TEntity> that can be used to query and save instances of TEntity.

Set<TEntity>(String)

Creates a DbSet<TEntity> that can be used to query and save instances of TEntity.

Set<TEntity>()

Creates a DbSet<TEntity> that can be used to query and save instances of TEntity.

public virtual Microsoft.EntityFrameworkCore.DbSet<TEntity> Set<TEntity> () where TEntity : class;
abstract member Set : unit -> Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> (requires 'Entity : null)
override this.Set : unit -> Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> (requires 'Entity : null)
Public Overridable Function Set(Of TEntity As Class) () As DbSet(Of TEntity)

Type Parameters

TEntity

The type of entity for which a set should be returned.

Returns

DbSet<TEntity>

A set for the given entity type.

Applies to

Set<TEntity>(String)

Creates a DbSet<TEntity> that can be used to query and save instances of TEntity.

public virtual Microsoft.EntityFrameworkCore.DbSet<TEntity> Set<TEntity> (string name) where TEntity : class;
abstract member Set : string -> Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> (requires 'Entity : null)
override this.Set : string -> Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> (requires 'Entity : null)
Public Overridable Function Set(Of TEntity As Class) (name As String) As DbSet(Of TEntity)

Type Parameters

TEntity

The type of entity for which a set should be returned.

Parameters

name
String

Returns

DbSet<TEntity>

A set for the given entity type.

Applies to