我只是想听听是否有更简单的方法来做到这一点。
public void Model(string _model)
{
var list =
from vehicle in vehiclesorted
where vehicle.Model == _model
orderby vehicle.Price
select vehicle;
vehiclesorted = list.ToList();
}
public void Brand(string _brand)
{
var list =
from vehicle in vehiclesorted
where vehicle.Brand == _brand
orderby vehicle.Price
select vehicle;
vehiclesorted = list.ToList();
}
public void Mph(int _mph)
{
var list =
from vehicle in vehiclesorted
where vehicle.Mph <= _mph
orderby vehicle.Price
select vehicle;
vehiclesorted = list.ToList();
}