Querying inside DbSet<T>

Asked by At

I want to query inside of a DbSet, but as I know there is just a FirstOrDefaultAsync method, which could return me an entity of my type. Is there a method for getting multiple entities inside a DbSet.

Something like:

dbSet.AsNoTracking()
     .Where(e => e.productName == productName && 
                 e.productDate == productDate)
     .ToList();

Thats just a example, but I need to return all entities which correspond to the expression. At this time I do not found something like this :(

If someone has a solution for this problem, I would be gratefull!

1 Answers

0
Philip Daubmeier On Best Solutions

You are missing a reference to using System.Linq: