Reverse a list c#
asp.net, c#
Solution
Reverse does the reversal in place and does not return anything. Instead do:
List<Entities.Notification> ProgramList = EventData.ToList();
ProgramList.Reverse();
ListViewEvents.DataSource = ProgramList;
ListViewEvents.DataBind();
Problem
I have inserted the EventData EntityList into a normal List and now I want to reverse it. But it gives the error "Cannot implicitly convert type 'void' to 'object'" ``` List<Entities.Notification> ProgramList = EventData.ToList(); ListViewEvents.DataSource = ProgramList.Reverse(); ListViewEvents.DataBind(); ``` How do I reverse this list? Is it possible to directly reverse the EntityList as well?