Skip to content

Instantly share code, notes, and snippets.

@patrick711
Created March 31, 2021 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrick711/49a7a0e361f0acb17742f162da16e773 to your computer and use it in GitHub Desktop.
Save patrick711/49a7a0e361f0acb17742f162da16e773 to your computer and use it in GitHub Desktop.
IEnumerable Scenario II
public void Test2()
{
//Method I
foreach (var cust in PXSelect<BAccount, Where<ISPSCustomerExtension.iSPSEDICust, Equal<True>>>.Select(this))
{
foreach (BAccount child in
PXSelect<BAccount, Where<BAccount.parentBAccountID, Equal<Required<BAccount.parentBAccountID>>>>
.Select(this, mycustomer.BAccountID))
{
}
}
//Method II
var ChildList = SelectFrom<BAccount>.Where<BAccount.parentBAccountID.IsNotNull>.View.Select(this)
.RowCast<BAccount>().ToList();
foreach (var cust in PXSelect<BAccount, Where<ISPSCustomerExtension.iSPSEDICust, Equal<True>>>.Select(this))
{
foreach (BAccount child in ChildList.Where(x=>x.ParentBAccountID==cust.BAccountID))
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment