Created
March 31, 2021 19:49
-
-
Save patrick711/49a7a0e361f0acb17742f162da16e773 to your computer and use it in GitHub Desktop.
IEnumerable Scenario II
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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