On the select and sorting query below … how would I be able to do the orderby of tmp on the TagId order of global?
Two lists … both have different number of items, but both have a field called TagId. I want to return the list of expensesSummary_MemberTmp but sorted by the order of TagId from expensesSummary_MemberTmp.
var expensesSummary_Member = from global in expensesSummary_Global.Select(x => x.TagId).ToList()
join tmp in expensesSummary_MemberTmp
on global equals tmp.TagId
orderby tmp.TagId
select tmp;
If you want to preserve the order of the first sequence, you shouldn’t order the result at all: