Dear All
I am new to LINQ 2 LLBGENPRO, and I am trying to do a query to retreive a list of Clients from the Clients table according to the Username and the LanguageCode.
My scenario is this.
I have a Clients Table linked to the CountriesByConsultants by the IDClient, and then the CountriesByConsultants table is linked to the ClientRegionLang by the CountryCode.
So I have the following query which is not working:-
private List<ClientEntity> GetClientEntity(IDataAccessAdapter adapter)
{
using (adapter)
{
LinqMetaData metaData = GetDataContext();
var ClientEntities = (from c in metaData.Client
select c).WithPath<ClientEntity>(cpath => cpath.Prefetch<CountriesByConsultantEntity>(cbc => cbc.IDClient)
.SubPath(opath => opath.Prefetch<ClientRegionLangEntity>(crl => crl.CountryCode)
)).ToList();
return ClientEntities;
}
}
Also I need to add a where clause to this, whereby ConsultantsLogon.Logon == Username, and LanguageCode = 'en'.
Thanks for your help and time
Johann