Answers for "linq query to fetch parent child data from same table in c#"

C#
0

linq query to fetch parent child data from same table in c#

var v = from p in db.tableName
        select new
        {
          ParentID = p.SerialNo,
          child = from c in db.tableName
                  where c.Parent == p.SerialNo select
                  new
                  {
                    ChildID = c.SerialNo,
                    ParentID = c.Parent
                  }
        };
Posted by: Guest on February-05-2021

Code answers related to "linq query to fetch parent child data from same table in c#"

C# Answers by Framework

Browse Popular Code Answers by Language