public T Find <T>(object id) where T : class { return(EntityEntries .Select(x => x.Instance) .OfType <T>() .FirstOrDefault(x => HasEntityId(x, id))); }
public IEnumerable <IDbEntityEntry> Entries() { return(EntityEntries.Select(x => new InMemoryDbEntityEntry(x))); }
public Task <T> FirstOrDefaultAsync <T>(Expression <Func <T, bool> > predicate, CancellationToken cancellationToken = default(CancellationToken)) where T : class { return(Task.FromResult(EntityEntries.Select(x => x.Instance).OfType <T>().FirstOrDefault(predicate.Compile()))); }
public T First <T>(Expression <Func <T, bool> > predicate) where T : class { return(EntityEntries.Select(x => x.Instance).OfType <T>().First(predicate.Compile())); }
public Task <T> GetAsync <T>(object id) where T : class { return(Task.FromResult(EntityEntries.Select(x => x.Instance).OfType <T>().First(x => HasEntityId(x, id)))); }
public IEnumerable <T> FindAllWithAdded <T>() where T : class { return(EntityEntries .Select(x => x.Instance) .OfType <T>()); }