以下两个查询之间是否存在任何性能差异?Linq以SQL最快的方式检索单个记录
CustomerProduct customerProduct = db.CustomerProducts.SingleOrDefault(p => object.Equals(p.Customer, this));
CustomerProduct customerProduct = (from p in db.CustomerProducts where object.Equals(p.Customer, this) select p).SingleOrDefault();
也许还有另一个,甚至更快?
你试过比较实际的SQL查询吗? – Snowbear