I am using Linq for sql to populate my object. I used to use delayed loading, and then repeated access to child objects through my list to force loading. This is not a good solution with the large dataset I have, so now I am setting LoadOptions in my data context to extract it first.
The only problem I encountered is that before I manually load one property at each iteration through my list, I'm not sure how to do it now. This is just a string value.
info.CreatedByName = info.CreatedBy.Name;
In my data context, I specify the boot options as such:
DataLoadOptions loadOptions = new DataLoadOptions();
loadOptions.LoadWith<Info>(info => info.Owner);
loadOptions.LoadWith<Info>(info => info.CreatedBy);
Is there a way to specify the purpose of this property in my boot options? Sort of:
loadOptions.LoadWith<Info>(info => info.CreatedByName)