For EntityCollection private EntityCollection RetrieveEntityByAttribute(ref IOrganizationService service, string _Entity, string[] _ColumnSet, string[] _AttributeRange, object[] _AttributeValue) { EntityCollection mcs_QueueItemComplaint = null; ColumnSet Indexcol = new ColumnSet(_ColumnSet); QueryByAttribute indexattribute = new QueryByAttribute(); indexattribute.EntityName = _Entity; indexattribute.Attributes.AddRange(_AttributeRange); indexattribute.Values.AddRange(_AttributeValue); indexattribute.ColumnSet = Indexcol; RetrieveMultipleRequest req_index = new RetrieveMultipleRequest(); ...