0
Возможно ли создать переменную IEnumerable
, которая указывает элементы для другого элемента на другой объект?Перечислитель свойства объектов списков
//...
SomeList<classA> MainList = new SomeList<classA>();
IEnumerable<string> InnerList = ??MainList??;
MainList.add(new classA());
Console.Writeline(InnerList.First());
// ->"Hello World"
//...
class classA{
public string innerObject = "Hello World";
}
Связанные Docs: http://stackoverflow.com/documentation/c%23/68/linq-queries/303/select-transforming-elements –