Home Recursion in a table using razor in ASP.NET Core

# Recursion in a table using razor in ASP.NET Core

Stian
1#
Stian Published in 2017-12-07 11:59:25Z
 I have this product category model: public class ProductCategory { public int Id { get; set; } public int? ParentId { get; set; } public string Title { get; set; } }  Using the parent Id, I want to display a list of categories and sub-categories (max three levels) in a tabeled list, like so: 
Category #1
Category #1.1
Category #1.2
Category #1.2.1
Category #1.2.2
Category #2
 I tried to implement this solution, but I don't understand how I'm supposed to pass the data to the partial view. And my categories don't have a reference to children, but rather to parents.
 You need to login account before you can post.
Processed in 0.33453 second(s) , Gzip On .