I have four tables:
- Client with PK ClientID. - Destination with PK DestinationID. - Language with PK LanguageID. - DestinationDetail with PK DestinationID. - RL-Client-Destination with PKs ClientID and DestinationID.
The Client may have zero or n Destinations. A destination has n DestinationDetails, each of these DestinationDetail has a language.
Ok. I need to retrieve all of DestinationDetails for a given client and a given language.
I start writing this:
try { ObjectQuery clientes = guiaContext.Cliente; ObjectQuery destinos = guiaContext.Destino; ObjectQuery idiomas = guiaContext.Idioma; ObjectQuery detalles = guiaContext.DetalleDestino; IQueryable detalleQuery = from cliente in clientes from destino in destinos from idioma in idiomas from detalleDestino in detalles where destino. select detalleDestino; } catch { } }
Any advice?
Thanks!
Its along the lines: