Join Linq To list outside of database
var filterList = new List<string>();
filterList.Add("OO172222");
filterList.Add("OO172232");
filterList.Add("OO172242");
filterList.Add("OO172252");
filterList.Add("OO172262");
filterList.Add("OO172272");
filterList.Add("OO172282");
filterList.Add("OO172302");
filterList.Add("OO172312");
filterList.Add("OO172322");
var rptRecords = (from wo in BucketEntities.tbl_SalesWorkOrder
join fi in BucketEntities.FranchiseInfoes on wo.FranchiseID equals fi.FranchiseID
join pc in BucketEntities.tbl_Pivotal_Company on fi.AccountCode equals
pc.Franchisee_Account_Code
join wot in BucketEntities.tbl_SalesWorkOrderTasks on new { wo.OrderID, wo.FranchiseID } equals
new { wot.OrderID, wot.FranchiseID }
where (wo.WSADate >= startdate && wo.WSADate <= enddate)
&& wot.AcceptedYN != false
where ((wo.DispatchCode == "DVC") || (wo.DispatchCode.Substring(0, 10) == "Dryer Vent")) ||
((filterList.Contains(wot.TaskCodeNumber) || wot.TaskCodeNumber == "00"))
filterList.Add("OO172222");
filterList.Add("OO172232");
filterList.Add("OO172242");
filterList.Add("OO172252");
filterList.Add("OO172262");
filterList.Add("OO172272");
filterList.Add("OO172282");
filterList.Add("OO172302");
filterList.Add("OO172312");
filterList.Add("OO172322");
var rptRecords = (from wo in BucketEntities.tbl_SalesWorkOrder
join fi in BucketEntities.FranchiseInfoes on wo.FranchiseID equals fi.FranchiseID
join pc in BucketEntities.tbl_Pivotal_Company on fi.AccountCode equals
pc.Franchisee_Account_Code
join wot in BucketEntities.tbl_SalesWorkOrderTasks on new { wo.OrderID, wo.FranchiseID } equals
new { wot.OrderID, wot.FranchiseID }
where (wo.WSADate >= startdate && wo.WSADate <= enddate)
&& wot.AcceptedYN != false
where ((wo.DispatchCode == "DVC") || (wo.DispatchCode.Substring(0, 10) == "Dryer Vent")) ||
((filterList.Contains(wot.TaskCodeNumber) || wot.TaskCodeNumber == "00"))
Comments