Monday, 19 October 2020
  2 Replies
  1K Visits
0
Votes
Undo
HI ,
I'd like to search an object by the value of Attribute ID 101227.do we have a High efficiency way to find this object or I have to find all objects then use linq to filter it ?

private List<ObjectItem> GetallChildren(ObjectItem item,int type=-1 )
{
ObjectDataRequest request = new ObjectDataRequest();
List<ObjectKindInfo> funckind = new List<ObjectKindInfo>() { new ObjectKindInfo() { CoverId = 123 } };
request.StartObjectId = item.ObjectId;
request.OutputObjectKindList = funckind;
request.SearchMode = SearchMode.Flat;
request.OutputDesignation = true;
if (type!=-1)
{
request.OutputAttributeList = new List<AttributeInfo>() { new AttributeInfo() { AttributeId = Comm.gs_Attr_TypeID } };
}
ObjectDataResponse respon = _proxy.GetObjectData(_databaseName, request);
return respon.ObjectData.ToList();
}
I use this to get all children then compare the value one by one.