Sure, here is the code:
DataAccessAdapter adapter = new DataAccessAdapter();
LogLayerEntity entity = new LogLayerEntity();
entity.Id = 11227821;
if (adapter.FetchEntity(entity))
Console.Write("{0}, {1}\n", entity.Id, entity.Name);
TllayerTestTypedList tl = new TllayerTestTypedList();
PredicateExpression pe = new PredicateExpression();
FieldCompareSetPredicate fcsp = new FieldCompareSetPredicate(null, null, CshTlPathFields.Id, null, SetOperator.Exist,
(CshTlPathFields.Id == LogTopologicalLinkFields.Id) & (CshTlPathFields.ACentreId == 11231011), false);
pe.Add(fcsp);
adapter.FetchTypedList(tl, pe);
for (int n = 0; n < tl.Rows.Count; n++)
{
Console.Write("\n";
for (int i = 0; i < tl.Rows[n].ItemArray.Length; i++)
Console.Write("{0}: {1} - {2}\n", n, tl.Columns[i].ColumnName, tl.Rows[n].ItemArray[i]);
}
But let's not concentrate on the previous C# code. I would appreciate if you could translate the following SQL code to LLBLGen equivalent:
select
l.id,
l.user_label_a,
lay.id,
lay.name
from
log_topological_link l,
log_layer lay
where exists
(select 1
from
csh_tl_path clp
where clp.id = l.id
and clp.a_centre_id = 11231011)
and lay.id = l.layer_id