public static IEnumerable<TEntity> LoadAll<TEntity>(
this DbContext dataContext
)
where TEntity : class, new()
<ExtensionAttribute>
Public Shared Function LoadAll(Of TEntity As {Class, New}) (
dataContext As DbContext
) As IEnumerable(Of TEntity)public:
[ExtensionAttribute]
generic<typename TEntity>
where TEntity : ref class, gcnew()
static IEnumerable<TEntity>^ LoadAll(
DbContext^ dataContext
)[<ExtensionAttribute>]
static member LoadAll :
dataContext : DbContext -> IEnumerable<'TEntity> when 'TEntity : not struct, new()The stored procedure name is determined by looking for the LoadAllStoredProcedureAttribute on the entity type. If the attribute is not present, the stored procedure name is assumed to be the same as the entity type name without the ResultSetSuffix property value. The stored procedure should not have any parameters or only parameters with acceptable default values in order to return all rows.
If the connection is not in an open state, it is opened temporarily while loading the entities. If change tracking is enabled on the data context, changes to the entities will be tracked. If not or the entity is marked with the NeverTrackAttribute, they will not be tracked.
using var dataContext = new MyDbContext();
var watchList = dataContext.LoadAll<WatchList>().ToList();