2using System.Collections;
3using System.Collections.Generic;
5using System.Linq.Expressions;
7using Microsoft.EntityFrameworkCore;
26 this.dbSet =
dbSet ??
throw new ArgumentNullException(nameof(
dbSet));
42 public void Add(TModel model) =>
dbSet.Add(model);
45 public void AddRange(IEnumerable<TModel> models) =>
dbSet.AddRange(models);
60 IEnumerator IEnumerable.GetEnumerator() =>
dbSet.AsQueryable().GetEnumerator();
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.