I am trying to create a Treeview using EF and MVC. For some reason I am not getting the tree correctly populated. Below are my codes.
public class ProductVM----> Parent
{
public ProductVM()
{
ProductPlatformVM = new List<ProductPlatformVM>();
}
public int ProductID { get; set; }
public string Name { get; set; }
public bool Inactive { get; set; }
public IList<ProductPlatformVM> ProductPlatformVM
{
get;
set;
}
}
}
public class ProductPlatformVM----> Child
{
public int PlatformVariantID { get; set; }
public string PlatformVariantName { get; set; }
public bool Archived { get; set; }
}
}
public class PlatformProductController : Controller
{
// GET: PlatformProduct
[HttpGet]
public ActionResult Index()
{
...
Go to the complete details ...