daelmo wrote:
Sure
You should use **ScalarQueryExpression **. Please read LLBLGenPro Help - Using generated code - Field expressions and aggregates.
Hope helpful.
I think your on the right track however, I am not able to make it work. I thought the scalarqueryexpression was for fetching aggregate values. I am not trying to get a aggregate value but actual values from the attribute table. What complicates it more is that a networkdevice has networkdeviceattributes which is a subclass of attribute. So I am not sure how to tie it all together. This is what i have so far and it seems to query all the attributes and not query based on the predicate that I have added.
ResultsetFields fields = new ResultsetFields(3);
fields.DefineField(NetworkDeviceFields.NetworkDeviceGuid, 0);
fields.DefineField(NetworkDeviceFields.Name, 1);
IRelationCollection _rcol = new RelationCollection(NetworkDeviceEntity.Relations.NetworkDeviceAttributeEntityUsingNetworkDeviceGuid);
fields.DefineField(new EntityField2("Cpu Count",
new ScalarQueryExpression(NetworkDeviceAttributeFields.Value,(NetworkDeviceFields.NetworkDeviceGuid == NetworkDeviceAttributeFields.NetworkDeviceGuid & NetworkDeviceAttributeFields.Name == "Cpu Count"),_rcol)),2);
DataTable results = new DataTable();
_adapter.FetchTypedList(fields, results, null);