I have one Parent table and its child table.I have to display title from parent and child table on page as given below in MVC project:
You can query the children and group them by their parent name. This assumes a ParentClient=>Client relationship.
var clientGroups = context.Clients.GroupBy(x => x.ParentClient.Name).OrderBy(x=>x.Key).ToList();
foreach (var clientGroup in clientGroups)
{
var parentName = clientGroup .Key;
foreach (var child in clientGroup)
{
var title = child.Name;
}
}