I know there are plenty of question about this topic but none of them seems to solve my answer (or at least from what i have found) pardon me if this is a duplicate question.
I have a list that i gather from SQL containing two properties SequenceId and Relevant:
var sequenceList = await context.SequenceDB.Where(c => c.PeopleId == peopleId).Select(c => {
SequenceId = c.SequenceId,
Relevant = c.Relevant
}).OrderBy(c => c.Relevant).ToListAsync();
Then i have another list like so:
var secondList = await context.Activity.ToListAsync();
FYI
- the second list has multiple properties (hence column in the database) and one of them is
SequenceIdpointing to thatSequenceIdinSequenceDB.
What i want is to order the secondList based on the order of GUID's in the sequenceList.
BUT:
- I just need to order them NOT exclude them from the list. And i don't want to exclude any of the elements from
secondList - The result will be a list of
Activitywith as first elements the ones fromsequenceListand then the rest
If you think this is a duplicate question please point me to the right one and i'll delete this one.
It seems simple even though is not for me.