I have a list of arrays that have a value called status. I want to sort these by placing the arrays with the "Active" status to the front of the list. This is to display the active elements first in a later function. Any good ideas how to sort and place the active "contracts" first?
IEnumerable<Contract> mappedContracts = MapContractsToContracts(contracts);
mappedContracts.OrderBy(x => x.Status == "Active");
return mappedContracts.ToList();
>Solution :
Presuming Status is a string and not other statuses are alphabetically before "Active".
IEnumerable<Contract> mappedContracts = MapContractsToContracts(contracts);
return mappedContracts
.OrderBy(x => x.Status)
.ToList();