If the SQL query I use to populate a generic List orders the result set like so (List<InventoryItem> inventoryItems
is populated):
SELECT id, pack_size, description, department+(subdepartment/100) AS Dept, vendor_id, vendor_item, ave_cost, unit_list FROM t_inv ORDER BY id, pack_size
...is it redundant (it seems to me that it is, but I want to verify it) to use .OrderBy().ThenBy() in subsequent LINQ code like this:
public IEnumerable<InventoryItem> Get(string ID, int packSize, int CountToFetch)
{
return inventoryItems
.Where(i => (i.Id.CompareTo(ID) == 0 && i.PackSize > packSize) || i.Id.CompareTo(ID) > 0)
.OrderBy(i => i.Id)
.ThenBy(i => i.PackSize)
.Take(CountToFetch);
}
?
I probably could afford the miniscule amount of additional Purina Gerbil Chow required to power this, but (call me a PETA pet if you will) I'd still rather not waste energy needlessly.