This question is locked. New answers and comments are not allowed.
I have a persistant class BasicProfile which contains a property HomeLocation.
The HomeLocation refers to a Location table.
Now I have a method:
public void retrieveBasicProfileMatches(
ref string query,
ref List<BasicProfile> searchResults,
ref IObjectScope objectScope)
The List is populated within the method.
After the call, I iterate through the list with a foreach but I get a null reference when trying to reference my HomeLocation data.
However, if I load a single BasicProfile using the id retrieved from the list, then the HomeLocation data is available:
foreach (BasicProfile b in searchResults)
{
...
// something = b.HomeLocation.Province + ", " + b.HomeLocation.CountryCode;
// bombs... but the following works
BasicProfile redundant = load(b.MemberId, objectScope).
something = redundant.HomeLocation.Province + ", " + b.HomeLocation.CountryCode; //works
...
}
Any ideas? note the objectScope is in scope the whole time.