我有以下业务实体,我想在此应用 LINQ。
public class DTPackage
{
private int _packageID;
private DTContract _flightComponent;
private HotelAvailability.HotelCollectionRow _hotelComponent;
.........
#region Public Properties
}
public partial class HotelCollectionRow : global::System.Data.DataRow
{
private global::System.Data.DataColumn columnSortByEngine;
private global::System.Data.DataColumn columnDistanceFromLocation;
private global::System.Data.DataColumn columnSortByDistanceFromLocationGroup;
private global::System.Data.DataColumn columnIsCommissionBased;
private global::System.Data.DataColumn columnSortByRank;
private global::System.Data.DataColumn columnSortByInternalRating;
}
我已经写了以下查询,但它不起作用。
我的查询
List<DTPackage> filterPackageList = null;
var query = filterPackageList.AsEnumerable()
.OrderByDescending(m => m.HotelComponent.DistanceFromLocation);
filterPackageList 充满了数据。