I can see this question has been asked a few times but I am puzzled as to how to implement for myself.
I am using SQL Lite and i am trying to join 2 tables but sometimes the 'linked' row in the 2nd table does not exist.
This is my code:
return from address in DB.Connector.Table<InformedWorkerModel.Tables.Address>()
join addressHistory in DB.Connector.Table<InformedWorkerModel.Tables.AddressHistory>()
on address.AddressRef equals addressHistory.AddressRef
where addressHistory.CustomerRef == customerRef
select new InformedWorkerModel.Tables.Address
{
Address1 = address.Address1,
Address2 = address.Address2,
Address3 = address.Address3,
Town = address.Town,
County = address.County,
Country = address.Country,
PostCode = address.PostCode,
AddressRef = address.AddressRef,
AddressId = address.AddressId
};
On Googling i can see a solution if I do not use a 'where' clause.. but i am..