Using .Select and .Where in a single LINQ statement
I need to gather Distinct Id's from a particular table using LINQ. The catch is I also need a WHERE statement that should filter the results based only from the requirements I've set. Relatively new to having to use LINQ so much, but I'm using the following code more or less: private void WriteStuff(SqlHelper db, EmployeeHelper emp) { String checkFieldChange; AnIList tableClass = new AnIList(db, (int)emp.PersonId); var linq = tableClass.Items .Where( x => x.UserId == emp.UserId && x.Date > DateBeforeChanges && x.Date < DateAfterEffective && ( (x.Field == Inserted) || (x.Field == Deleted))) ) )