I have a WCF Service which retreives data via Linq2SQL. I am getting all the child records, just not the related parent records
i.e Customer record has related Orders, and there is a status on the customer. I am getting the customer and the orders, but I cannot get the status record to get the status description
using (MyDataContext context = new MyDataContext(CommonCode.DBConnectionString))
{
context.DeferredLoadingEnabled = false;
DataLoadOptions options = new DataLoadOptions();
options.LoadWith<Customer>(u => u.Orders);
options.LoadWith<Customer>(u => u.CustomerStatus);
context.LoadOptions = options;
context.ObjectTrackingEnabled = false; // retrieving data read only
return context.Customers.SingleOrDefault<Customer>(
cus=> cus.CustomerId == passedId );
}
I have tried playing with the Deferred Loading and object tracking (which I do not need on) and are running out of ideas.
Can anyone help on how I can return the Customer Status record please.