protected override void ProcessRecord() { SyncRelationship relationship = CmdletCommon.GetSyncRelationship(this.RelationshipId); if (this.SyncHistoryId > 0) { this.WriteObject( relationship.GetSyncJobHistory().FirstOrDefault(r => r.Id == this.SyncHistoryId)); return; } using (var db = relationship.GetDatabase()) { if (this.SyncHistoryId > 0) { this.WriteObject( db.History.FirstOrDefault(h => h.Id == this.SyncHistoryId)); return; } // Copy all history items to a list to prevent enumerating multiple // tables at the same time. var histories = db.History.ToList(); foreach (var history in histories) { this.WriteObject(history); } } }
protected override void ProcessRecord() { SyncRelationship relationship = CmdletCommon.GetSyncRelationship(this.RelationshipId); if (this.SyncJobId == 0 && relationship.ActiveJob == null) { } }
protected override void ProcessRecord() { SyncRelationship relationship = CmdletCommon.GetSyncRelationship(this.RelationshipId); if (relationship.ActiveAnalyzeJob == null) { throw new ItemNotFoundException("There is no active analyze job for this relationship"); } var psRun = new PSAnalyzeJob(relationship.ActiveAnalyzeJob); this.WriteObject(psRun); }
protected override void ProcessRecord() { SyncRelationship relationship = CmdletCommon.GetSyncRelationship(this.RelationshipId); using (var db = relationship.GetDatabase()) { if (this.SyncHistory != null && this.SyncHistoryId == 0) { this.SyncHistoryId = this.SyncHistory.Id; } var entries = db.HistoryEntries.Where(e => e.SyncHistoryId == this.SyncHistoryId).ToList(); foreach (SyncHistoryEntryData entry in entries) { this.WriteObject(new PSSyncHistoryEntry(entry)); } } }