I'm trying to get rows based on a WHERE clause in a DbSet object. I have this:
dbContext.Workers
I can get a list like this:
workers = m.Workers.Where(w => w.BranchId == curUser.BranchId).ToList<Worker>();
But as you can see, it returns a List<Worker> and I can't use methods like workers.Find(WorkerId) with it.
Basically, I'm trying to return a DBSet based on some filter I mean I want to use LINQ on a DBSet class. I want this because I need to use workers.Find(WorkerId) also maybe I will need to update this model. So, I will get a list based on where clause, I will change some values and will use dbContext.SaveChanges(). Is that possible?
Thanks