tags:

views:

36

answers:

0

I´m using a Wcf service and in the data access layer I use this code:

public BindingList getPeople(s)
{
    IQueryable<Personal> query;
    EntidadesDataContext dc = GetDC();
    DataLoadOptions loadOptions = new DataLoadOptions();
    loadOptions.LoadWith<People>(pp=> pp.PeopleDepartment);
    loadOptions.LoadWith<PeopleDepartment>(pd=> pd.Department); // is what I lose in the UI
    dc.LoadOptions = loadOptions;
    query = from people in dc.People select people;

    return QueryToBindingList(query);
}

this code returns the data complete and exactly as I want, then I call it from the service and adding it to a BindingList

peopleBindingList = currentConnection.ServiceClient.People_GetPeople();

at peopleBindingList I lose the department values .... for example...

peopleBindingList.Select(pp=>pp.PeopleDepartament.First().Departament) ... returns Null

I check first that it's data to return...