I have the following class:

```
public class Products
{
    public int ID { get; set; }
    public int KeyID { get; set; }    
    public int KeyLevel { get; set; }    
    public string COMBasis { get; set; }            
}

```

Here ID is the primary key and KeyID contains the parent ID of the item. KeyLevel contains the level of the node in the hierarchical tree. I have to set the COMBasis property for all the children if the parent's property is changed. How can I get the children?

Following is what I am already doing but I am stuck in the after KeyLevel part:

```
foreach (Products prod in ProductList.Where(x => x.KeyID == prd.ID))
{
    while(prod.KeyLevel!=6)
    prod.COMStandard = prd.COMStandard;    
}

```