Subsonic Delete multiple records

subsonic

I have a table which has a two fields, userid and degreeid. A user can have multiple degreeds in this table. When a user select their degree I want to delete any degree id already in the database but un-selected by user. How should do it? I try to use something like this with no luck.

repo.DeleteMany(x=>x.MeetingAttendeeUserID==userID && x.EducationDegreeID userDegreeList)

Thanks,
Lewis

Best Answer

Could you do something like this?

repo.DeleteMany(x =>
    x.MeetingAttendeeUserId == userID &&
    x.EducationDegreeID != selectedDegreeId
);

Edit: Or this.

repo.DeleteMany(x =>
    x.MeetingAttendeeUserId == userID &&
    userDegreeList.Contains(x.EducationDegreeID))
);