protected virtual IEnumerable <TDataObject> GetPagedData() { QueryFilter internalFilter = this.InternalFilter; base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(base.DataSession, typeof(TDataObject), internalFilter, this.RootId, this.DeepSearch)); return(base.DataSession.FindPaged <TDataObject>(internalFilter, this.RootId, this.DeepSearch, this.InternalSortBy, this.PageSize)); }
protected override IConfigurable PrepareDataObject() { TaskLogger.LogEnter(); IEnumerable <TDataObject> enumerable = null; base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(base.DataSession, typeof(TDataObject), this.InternalFilter, this.RootId, this.DeepSearch)); try { enumerable = base.DataSession.FindPaged <TDataObject>(this.InternalFilter, this.RootId, this.DeepSearch, null, 0); } catch (DataSourceTransientException exception) { base.WriteError(exception, (ErrorCategory)1002, null); } finally { base.WriteVerbose(TaskVerboseStringHelper.GetSourceVerboseString(base.DataSession)); } if (enumerable == null) { base.WriteError(new ManagementObjectNotFoundException(Strings.ExceptionObjectNotFound(typeof(TDataObject).ToString())), (ErrorCategory)1003, null); } IConfigurable configurable = null; using (IEnumerator <TDataObject> enumerator = enumerable.GetEnumerator()) { if (enumerator.MoveNext()) { configurable = enumerator.Current; if (enumerator.MoveNext()) { base.WriteError(new ManagementObjectAmbiguousException(Strings.ExceptionObjectAmbiguous(typeof(TDataObject).ToString())), (ErrorCategory)1003, null); } } else { base.WriteError(new ManagementObjectNotFoundException(Strings.ExceptionObjectNotFound(typeof(TDataObject).ToString())), (ErrorCategory)1003, null); } } ADObject adobject = configurable as ADObject; if (adobject != null) { base.CurrentOrganizationId = adobject.OrganizationId; } if (base.CurrentObjectIndex == 0) { this.ResolveLocalSecondaryIdentities(); if (base.HasErrors) { return(null); } } TaskLogger.LogExit(); return(configurable); }
// Token: 0x060005D8 RID: 1496 RVA: 0x000163E4 File Offset: 0x000145E4 protected override IConfigurable ResolveDataObject() { TaskLogger.LogEnter(); IConfigurable[] array = null; base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(base.DataSession, typeof(TDataObject), this.InternalFilter, this.RootId, this.DeepSearch)); try { array = base.DataSession.Find <TDataObject>(this.InternalFilter, this.RootId, this.DeepSearch, null); } catch (DataSourceTransientException exception) { base.WriteError(exception, (ErrorCategory)1002, null); } finally { base.WriteVerbose(TaskVerboseStringHelper.GetSourceVerboseString(base.DataSession)); } if (array == null) { array = new IConfigurable[0]; } IConfigurable result = null; switch (array.Length) { case 0: base.WriteError(new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound(null, typeof(TDataObject).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), (ErrorCategory)1003, null); break; case 1: result = array[0]; break; default: base.WriteError(new ManagementObjectAmbiguousException(Strings.ExceptionObjectAmbiguous(typeof(TDataObject).ToString())), (ErrorCategory)1003, null); break; } TaskLogger.LogExit(); return(result); }