I don't know if the relations are all m:1/1:1 from Site to the other entities. If so, you can add the filters together with the relations in 1 go:
q = q.Where(s=>s.Address.Country.Region.RegionCode==regionCode);
and you then don't have to add the joins.
If not, you need the joins to be added for every filter. Below I assumed some relations are 1:n, so you needed all joins.
LinqMetaData metaData = new LinqMetaData(adapter);
// first create the base query.
var baseq = from s in metaData.Site
orderby s.SiteId ascending
select s;
// then add the filters, based on variables
var q = baseq
if(!String.IsNullOrEmpty(regioncode))
{
q = from s in q
join a in metaData.Address on s.AddressGuid equals a.AddressGuid
join c in metaData.Country on a.CountryCode equals c.CountryCode
join r in metaData.Region on c.RegionCode equals r.RegionCode
where r.RegionCode == regioncode
select s;
}
if (!String.IsNullOrEmpty(countrycode))
{
q = from s in q
join a in metaData.Address on s.AddressGuid equals a.AddressGuid
join c in metaData.Country on a.CountryCode equals c.CountryCode
where c.CountryCode == countrycode
select s;
}
if(excludedecommisioned)
{
q = from s in q
where !s.Decomissioned
select s;
}
// then add the final projection, just the siteId field;
q = q.Select(s=>s.SiteId);
At least, I think this will get you very far