I have a table RecentChanges which holds reference to all actions done on my website. It contains the Type of the action done (e.g. edit, upload, etc.), a Revision ID foreign key (which references to the ID in the Revisions table – can be null) and a Log ID foreign key (which references to the ID in the Logs table – can be null). Both the last two tables mentioned contain a timestamp of when the action occurred.
My problem is how can I order the results from the RecentChanges table to be displayed in descending order since the timestamp values are in two separate tables?
To get an idea here is a snippet of Linq query:
var list = (from r in Entity.RecentChanges
//where clause??
select r);
Something like this? I’m projecting into an anoymous type to help with the ordering (you’ll need to add other fields that you need into the projection):