public static List getChildId(int Parentid)
{
using (dbEntities dbcontext = new dbEntities())
{
List childid = new List(dbcontext.employee.Where(w => w.ParentId == Parentid).Select(w => w.Id));
foreach (var id in childid.ToList())
{
List childs = getChildId(id);
childid.AddRange(childs);
}
return childid;
}
}