Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var someVariable = MainMethodToCall(rowId)
  2.  
  3. public ICollection<RowObject> MainMethodToCall(int rowId)
  4. {
  5. ICollection<RowObject> rowsCollection = new Collection<RowObject>();
  6. rowsCollection = GetChildRows(rowId,rowsCollection);
  7. return rowsCollection;
  8. }
  9.  
  10. public ICollection<RowObject> GetChildRows(int rowId, ICollection<RowObject> rowsCollection) {
  11. var rowObject= DatabaseCall.GetRowObject();
  12. rowsCollection.Add(position);
  13. if (DatabsaeCall().Where(x => x.ParentRowId == rowId).Any())
  14. {
  15. var childRows = DatabaseCall().Where(x => x.ParentRowId == rowId);
  16. foreach (var childRow in childRows )
  17. {
  18. GetChildRows(childRow.Id, rowsCollection);
  19. }
  20. }
  21. return rowsCollection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement