I have the following test code to search a generic list:
public void DoSearch(string searchTerm)
{
IList<MyEntity> entities = GetCollectionOfEntities();
IList<MyEntity> results = entities.Where(d => d.Description.Contains(searchTerm)).ToList();
}
I want to pass an order by parameter (which would be a property of MyEntity) and of course order my results based on that. I understand LINQ uses OrderBy but do not understand how to order by a property of MyEntity.