|
-
Sep 7th, 2023, 03:48 AM
#2
Re: Highly confused on how to order by objects inside an object
OrderBy doesn't sort a list. It creates a new list that contains the same items as the original list but in the order specified. If you're not assigning the result to something, you're not doing anything useful. Just as you're doing an assignment outside the loop, you would have to do an assignment inside the loop too.
That said, if the Sessions property is a List(Of T) then why call OrderBy at all? That List already has its own Sort method that allows you to sort it in place, so there's no assignment necessary.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|