DbContext.Set(Of TEntity) 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.]
Returns a DbSet(Of TEntity) instance for access to entities of the given type in the context and the underlying store.
Assembly: EntityFramework (in EntityFramework.dll)
'Declaration <SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId := "Set")> _ Public Overridable Function Set(Of TEntity As Class) As DbSet(Of TEntity) 'Usage Dim instance As DbContext Dim returnValue As DbSet(Of TEntity) returnValue = instance.Set()
Type Parameters
- TEntity
The type entity for which a set should be returned.
Note that Entity Framework requires that this method return the same instance each time that it is called for a given context instance and entity type. Also, the non-generic DbSet returned by the Set(Type) method must wrap the same underlying query and set of entities. These invariants must be maintained if this method is overridden for anything other than creating test doubles for unit testing. See the DbSet(Of TEntity) class for more details.
Show: