I just asked a question about my class:
Public class Parent { public IList<ParentDetail> ParentDetails { get { return _ParentDetails; } } private List<ParentDetail> _ParentDetails = new List<ParentDetail>(); public Parent() { this._ParentDetails = new List<ParentDetail>(); } } public class ParentDetail { public int Id { get; set; } } }
One of the experts here (John) told me how I can go through this class in order in ParentDetails.Id. Here is his solution that works well. Previous question
foreach(var details in Model.Parent.ParentDetails.OrderBy(d => d.Id)) {
What I also need is inside this foreach to show the index value of the list corresponding to Id along with some other data that is in the ParentDetail class.
So, for example, when he says that the details are being processed, I want to be able to print the index value corresponding to the current identifier in the foreach loop.
Emily source share