using System.Collections.Generic;
public static void Main()
var loc1 = new Location(){
var loc2 = new Location(){
var locList = new List<Location>(){
var saleT1 = new SaleTransaction(){
var saleT2 = new SaleTransaction(){
var saleT3 = new SaleTransaction(){
var saleList = new List<SaleTransaction>(){
Console.WriteLine("Join on locationId = 2");
var locId2List = saleList.Join(locList, s => s.LocationId, l => l.Id, (s, l) => new {s.Id, s.Name, s.LocationId, locationName = l.Name})
.Where(l => l.LocationId == 2);
foreach(var item in locId2List){
Console.WriteLine("\t" + item.Id + " " + item.Name + " " + item.LocationId + " " + item.locationName + "\n");
public class SaleTransaction
public int LocationId {get;set;}
public string Name {get;set;}
public string Name {get;set;}