Not not a keyword in LINQ queries, so you get compiler errors. You need to use the inequality operator ( != ) To check if FilePath .
The code below should work for you
var query = from c in dbContext.table where c.FacilityID == facilityID && c.FilePath != null select c;
Jehof source share