How can I loops the list of object strating from last position object in c#. Here, I have asp.net mvc 3 application where I need to create the directory to upload the path according to the category available if directory is not available. But list of category object are in opposite order where child category is at first position. I want to create the folder of child category inside the parent category. so I want to start the loops in reverse order or is there any function to reverse the list of category object. I have following foreach loops:
foreach (var item in parentcategory)
{
categorypath += item.CategoryName + "/" ;
}
any helps is greatly appreciated
Simpliest solution, but not most efficient is:
or: