I've got a LINQ query which looks like this:
var query = from produkt in Entity.ProduktCollection.produktCollection
let p = produkt as Entity.Produkt
from version in p.version
let v = version as Entity.Version
from customer in v.customerCollection
let c = customer as Entity.Customer
from fehler in v.fehlerCollection
let f = fehler as Entity.Fehler
where f.id == GetGuid();
select p;
but what I really need is a way to make the f plus its property as well as the p variable, so I might change them to every other possible combination, for example:
where c.name == "frank"
select f;
or
where p.id == GetGuid2()
select c;
Is there any way to achieve this? As far as I know there is no way to insert a switch-case block inside the query between the from/let-part and the where/select-part.