2using System.Collections;
3using System.Collections.Generic;
5using System.Linq.Expressions;
8using Microsoft.EntityFrameworkCore;
27 this.dbSet =
dbSet ??
throw new ArgumentNullException(nameof(
dbSet));
43 public void Add(TModel model) =>
dbSet.Add(model);
46 public void AddRange(IEnumerable<TModel> models) =>
dbSet.AddRange(models);
52 public IAsyncEnumerator<TModel>
GetAsyncEnumerator(CancellationToken cancellationToken =
default) =>
dbSet.AsAsyncEnumerable().GetAsyncEnumerator(cancellationToken);
64 IEnumerator IEnumerable.GetEnumerator() =>
dbSet.AsQueryable().GetEnumerator();
IAsyncEnumerator< TModel > GetAsyncEnumerator(CancellationToken cancellationToken=default)
void Add(TModel model)
Add a given model to the the working set.
void Attach(TModel model)
Attach a given model to the the working set.
void RemoveRange(IEnumerable< TModel > models)
Remove a range of models from the IDatabaseCollection<TModel>.
IEnumerator< TModel > GetEnumerator()
void Remove(TModel model)
Remove a given model from the the working set.
readonly DbSet< TModel > dbSet
The backing DbSet<TEntity>.
DatabaseCollection(DbSet< TModel > dbSet)
Initializes a new instance of the DatabaseCollection<TModel> class.
IEnumerable< TModel > Local
An IEnumerable<T> of TModel s prioritizing in the working set.
void AddRange(IEnumerable< TModel > models)
Add a range of models to the IDatabaseCollection<TModel>.
Represents a database table.