I am trying to create a Lambda query of my database searching for students that have taken classes but have not paid for their classes. I am passing in a StudentID (datatype string) and searching the CLASS and PAYMENT tables looking for COUNT of the records in the CLASS table that do NOT have a matching record in the PAYMENT table.
CLASS table has a StudentID field and a ClassID field (datatype GUID) PAYMENT table has a ClassID field (datatype GUID).
My new to LINQ and Lambda and haven't gotten very far as I keep getting syntax errors. Help would be sincerely appreciated.
int unPaidClasses =
db.CLASS
.Join(db.PAYMENT,
class => class.ClassID,
pay => pay.ClassId,
(class, pay) => new { CLASS = class, PAYMENT = payment })
.Where(x =>