using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
foreach (var billTo in load.billTos)
var customers = load.billToStops
.Where(b => b.billToSeqNum == billTo.seqNum)
.Join(load.customerStops, bs => bs.stopSeqNum, cs => cs.stopSeqNum, (bs, cs) => cs)
.Join(load.customers, cs => cs.custSeqNum, c => c.custSeqNum, (cs, c) => c)
Console.WriteLine("Bill To: " + billTo.seqNum);
foreach (var cust in customers)
Console.WriteLine("Customer Code: " + cust.CCode);
public List<BillTo> billTos { get; set; }
public List<BillToStop> billToStops { get; set; }
public List<CustomerStop> customerStops { get; set; }
public List<Customer> customers { get; set; }
public string seqNum { get; set; }
public string billToSeqNum { get; set; }
public string stopSeqNum { get; set; }
public class CustomerStop
public string stopSeqNum { get; set; }
public string custSeqNum { get; set; }
public string custSeqNum { get; set; }
public string CCode { get; set; }
public static Load GetLoad()
billTos = new List<BillTo>(){
billToStops = new List<BillToStop>(){
customerStops = new List<CustomerStop>(){
customers = new List<Customer>(){