Скажите, у меня есть класс с 2 свойствами
class TestClass
{
public int propertyOne {get;set;}
public List<int> propertyTwo {get; private set;}
public TestClass()
{
propertyTwo = new List<int>();
}
}
Используя linq, я пытаюсь создать список TestClass следующим образом:
var results = from x in MyOtherClass
select new TestClass()
{
propertyOne = x.propertyFirst,
propertyTwo = x.propertyList
};
propertyTwo = x.propertyList фактически выдает ошибку с волнистым красным подчеркиванием.
Как реализовать в этом случае эквивалент свойства Two.AddRange (other)?
Приветствия