Example #1
0
 public static Prr GetMatchingPrr(this Pir pir)
 {
     return(pir.After()
            .OfExactType <Prr>()
            .Where(r => r.HeadNumber == pir.HeadNumber && r.SiteNumber == pir.SiteNumber)
            .FirstOrDefault());
 }
Example #2
0
 /// <summary>
 /// Gets the records associated with this pir
 /// </summary>
 /// <param name="pir">The <see cref="Pir"/> representing the part</param>
 /// <returns>The records associated with the part (between the <see cref="Pir"/>
 /// and <see cref="Prr"/> and sharing the same head/site information.</returns>
 public static IEnumerable <StdfRecord> GetChildRecords(this Pir pir)
 {
     return(pir.After()
            .OfType <IHeadSiteIndexable>()
            .Where(r => r.HeadNumber == pir.HeadNumber && r.SiteNumber == pir.SiteNumber)
            .TakeWhile(r => r.GetType() != typeof(Prr))
            .Cast <StdfRecord>());
 }