"You don't need the
Whereclause. Replace withfoo.FirstOrDefault(...)"
Using Where with FirstOrDefault clause or using FistOrDefault alone will make the same SQL statement. While the second approach is shorter and more meaningful.
var myObj = foo.Where(a => a.Id == id).FirstOrDefault();should be 🡻
var myObj = foo.FirstOrDefault(a => a.Id == id);