public IEnumerable <ClassificationReference> GetClassificationReferences(PlanOfWork pow) { if (ClassificationReferenceIds == null || !ClassificationReferenceIds.Any()) { yield break; } if (pow.ClassificationSystems == null || !pow.ClassificationSystems.Any()) { yield break; } foreach (var reference in from system in pow.ClassificationSystems where system.ClassificationReferences != null && system.ClassificationReferences.Any() from reference in system.ClassificationReferences where ClassificationReferenceIds.Contains(reference.Id) select reference) { yield return(reference); } }
/// <summary> /// Gets all classification references based on IDs /// </summary> /// <param name="pow">Plan of work in which this object and classification references live</param> /// <returns>Enumeration of classification references</returns> public IEnumerable <ClassificationReference> GetClassificationReferences(PlanOfWork pow) { if (ClassificationReferenceIds == null || pow.ClassificationSystems == null) { yield break; } foreach (var reference in from classification in pow.ClassificationSystems where classification.ClassificationReferences != null from reference in classification.ClassificationReferences where ClassificationReferenceIds.Contains(reference.Id) select reference) { yield return(reference); } }