Может кто-то пожалуйста, помогите со следующими ... это сводит меня с ума ...Создание шаблонного метода
// Three methods, virtually identical with the exception of the select field
public IEnumerable<int> GetBrandID()
{
return myData.Select(m => m.BrandID).Distinct();
}
public IEnumerable<int> GetModelID()
{
return myData.Select(m => m.ModelID).Distinct();
}
public IEnumerable<int> GetVehicleID()
{
return myData.Select(m => m.VehicleID).Distinct();
}
// How to create one method which returns the type specified in the parameter??
public IEnumerable<int> GetData(??? myType)
{
return myData.Select(m => myType).Distinct();
}
Один пират спросил другой, «? Почему этот корабль колеса торчат из штанов» ... –