我有以下通用扩展方法:publicstaticTGetById(thisIQueryablecollection,Guidid)whereT:IEntity{Expression>predicate=e=>e.Id==id;Tentity;//Allowreportingmoredescriptiveerrormessages.try{entity=collection.SingleOrDefault(predicate);}catch(Exceptionex){thrownewInvalidOperationException(string.Format("Therewasanerr