I'm newbie in C#. Perhaps this is too simply to resolve but I'm really away of the solution.
I have this class:
public class TestSetups : TabelaCtset { public IList<TabelaCtsca> ValSetup { get { return m_valsetup; } } private static List<TabelaCtsca> m_valsetup; /// Constructor public TestSetups(IDefinitionList dlist) : base(dlist) { m_valsetup = new List<TabelaCtsca>(); } } I have another class called TestCase
public class TestCase : TabelaCttes { public IList<TestSetups> Setups { get { return m_setups; } } private List<TestSetups> m_setups; ... testcase.m_setups = new List<TestSetups>(); defs = gdl.GetDefinitions(testcase); while (defs.MoveNext()) { TestSetups testsetup = new TestSetups(defs); IDefinitionList valsetup = gdl.GetDefinitions(testsetup); { TabelaCtsca ctsca = new TabelaCtsca(valsetup); testsetup.ValSetup.Add(ctsca); } testcase.Setups.Add(testsetup); } return testcase; ... } I want to put all ctsca values in a ValSetup list. All works fine, except this line testcase.Setups.Add(testsetup);: I have the the properties of TestSetups class but my ValSetup property is always empty, when my while goes to another iteration.
Sorry for this weird explanation. I'm able to explain in more detail.
Update: In this situation, I store in each TestSetup just the last ValSetup value and not all the ValSetup of each TestSetup.