Depot Model public class Depot { [Key] public int DepotNo { get; set; } public string DepotName {get;set;} ` } public class Department { [Key] public int DepartmentID{ get; set; } public string DepartmentName {get;set;} } public class DepartmentWorkTime { [Key] public int Id { get; set; } public int DepotNo { get; set; } public int DepartmentID { get; set; } public DepotModel Depot { get; set; } public DepartmentModel Department { get; set; } } Depot Model {1, .AAAA Depot}, {2, BBBB Depot}, {4, CCCC Depot}, Department Model {1, Retail}, {2, Office}, {3, Field Staff}, {4, Warehouse}, DepartmentWorkTime List {1,1,1, Depot Model ,Department Model}, {2,1,2, Depot Model ,Department Model}, {3,1,4, Depot Model ,Department Model}, {4,2,1, Depot Model ,Department Model}, {5,2,2, Depot Model ,Department Model}, {6,2,3, Depot Model ,Department Model}, {7,4,1, Depot Model ,Department Model}, Mapping View Model public class DepartmentMapModel { public string id { get; set; } public string title { get; set; } } public class DepotMapModel { public string id { get; set; } public string title { get; set; } public List subs { get; set; } } I am trying to get the result as given below [0] = { id = 1, title = "1-AAAA Depot", subs = {System.Collections.Generic.List<<>f__AnonymousType10>} } Subs [0] { id = "1.1", title = "1.Retail" } [1] { id = "1.2", title = "1.Office" } [2] { id = "1.4", title = "1.Warehouse" } [1] = { id = 2, title = "2-BBBB Depot", subs = {System.Collections.Generic.List<<>f__AnonymousType10>} } Subs [0] { id = "2.1", title = "2.Retail" } [1] { id = "2.2", title = "2.Office" } [2] { id = "2.3", title = "2.Field Staff" } [2] ={ id = 3, title = "4-CCCC Depot", subs = {System.Collections.Generic.List<<>f__AnonymousType10>} } Subs [0] { id = "4.1", title = "4.Retail" }