private void CloseExecutionIfIncomplete(IDocumentSession session, CollectRequest collectRequest, CollectExecution collectExecution, FamilyEnumeration plataform, IEnumerable <ObjectType> objectTypes) { IEnumerable <SelectedProbe> objectsNotSupported = ProbeManager.GetNotSupportedObjects(objectTypes, plataform); var objectNotSupported = this.GetObjectTypesFromSelectedProbes(objectsNotSupported); var objectSupportedNotCollect = objectTypes.Except(objectNotSupported); this.CreateCollectedObjectsForNotSupportedObjects(session, objectsNotSupported, collectRequest, collectExecution); if (objectSupportedNotCollect.Count() > 0) { IEnumerable <SelectedProbe> objectsSupportedNotCollected = ProbeManager.GetProbesFor(objectSupportedNotCollect, plataform); this.CreateCollectedObjectsForNotSupportedObjects(session, objectsSupportedNotCollected, collectRequest, collectExecution); } collectRequest.SetResultComplete(session); collectRequest.Close(); session.SaveChanges(); }