I have two classes, one that inherits from the other. The derived class is like this:
And the base class, which have a list, is like this:
Now, when I do
, the property
is
.
What am I doing wrong?
I verified that the correct constructor of the base class is called, although, it seems that the derived class doesn´t inherit the list from the base class.
C#:
public class AppStateData : GlobalFilterModel
{
public AppStateData() : base(4)
{
}
public AppStateData(int nfilters) : base(nfilters)
{
}
}
And the base class, which have a list, is like this:
C#:
public class GlobalFilterModel
{
public EntryState state { get; set; }
public List<FilterModel> FilterInfo { get; set; }
public GlobalFilterModel()
{
}
public GlobalFilterModel(int n)
{
List<FilterModel> FilterInfo = new List<FilterModel>();
for (int i = 0; i < n; i++)
FilterInfo.Add(new FilterModel());
}
}
Now, when I do
C#:
new AppStateData()
C#:
FilterInfo
C#:
null
What am I doing wrong?
I verified that the correct constructor of the base class is called, although, it seems that the derived class doesn´t inherit the list from the base class.