Linq-To-SQL Multiple Trips to the Database
I'm trying to make my Linq-to-SQL query more efficient by including child properties in one trip to the DB. I started by trying various linq queries to accomplish this. The queries were getting complex, so I tried the LoadWith() option: The constructor of my DAL class sets the LoadWith() settings: public TrackerJobData() { dataLoadOptions = new DataLoadOptions(); dataLoadOptions.LoadWith<TrackerJobRecord>(x => x.SpecBarcodeRecords); dataLoadOptions.LoadWith<TrackerJobRecord>(x => x.TrackerJobEquipmentTriggerRecords); dataLoadOptions.LoadWith<TrackerJobRecord>(x => x.EtaRecord); this.Database