Share via


DbExtensions Class

Definition

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification="Casing is intentional")]
public static class DbExtensions
type DbExtensions = class
Public Module DbExtensions
Inheritance
DbExtensions
Attributes

Methods

AsNoTracking(IQueryable)

Returns a new query where the entities returned will not be cached in the DbContext or ObjectContext. This method works by calling the AsNoTracking method of the underlying query object. If the underlying query object does not have a AsNoTracking method, then calling this method will have no affect.

AsNoTracking<T>(IQueryable<T>)

Returns a new query where the entities returned will not be cached in the DbContext or ObjectContext. This method works by calling the AsNoTracking method of the underlying query object. If the underlying query object does not have a AsNoTracking method, then calling this method will have no affect.

Include(IQueryable, String)
Include<T,TProperty>(IQueryable<T>, Expression<Func<T,TProperty>>)
Include<T>(IQueryable<T>, String)
Load(IQueryable)

Enumerates the query such that for server queries such as those of DbSet<TEntity>, ObjectSet<TEntity>, ObjectQuery<T>, and others the results of the query will be loaded into the associated DbContext, ObjectContext or other cache on the client. This is equivalent to calling ToList and then throwing away the list without the overhead of actually creating the list.

ToBindingList<T>(ObservableCollection<T>)

Returns an BindingList<T> implementation that stays in sync with the given ObservableCollection<T>.

Applies to