sorting - Ordering a list of objects by another object's property in C# -
We have a system based around the events that are invited to the user [UserInvite].
Currently, I have a page that lists all the users invited to the event; They can be solved by various properties, such as surname [ascending and descending]. All are fine and dandy, but now I need to sort extra by a UserInvite property: DateEdited [again asc / desc] I am using an extension method that takes a string of property name to sort, but This will not work for the property of other classes.
Note:
- In the UserInvite there is a method of getting the event and user, which always gives a single user input [or if no one was invited] < / Li>
- The current event is organized in the Master page, so that the user's list
What is the best way to do this?
what event
to userinvite
? If so, just let the relationship go. In fact, event
- ie
date of the public date; }} // or the same sort by
and InviteDate
- but you can also use a string like "Invite.Date" and it can be used by dots Can divide - for example, IQueryable & lt; T & gt; There is something similar to
- although it currently does not handle null
.
Comments
Post a Comment