S
shapper
Hello,
I have a class as follows:
public class Theme {
public Subject Subject { get; set; }
public List<Level> Levels { get; set; }
public string Note { get; set; }
public Theme() {
this.Levels.Add(new Level { Type = LevelType.Basico,
Description = "Test" });
}
Level is a class with two properties:
- Type (of type LevelType which is an Enum)
- Description which is a string
I am getting an error:
Object reference not set to an instance of an object.
What am I doing wrong?
Probably this is something simple but I have been around this and I
can't figure out what I am doing wrong.
Thanks,
Miguel
I have a class as follows:
public class Theme {
public Subject Subject { get; set; }
public List<Level> Levels { get; set; }
public string Note { get; set; }
public Theme() {
this.Levels.Add(new Level { Type = LevelType.Basico,
Description = "Test" });
}
Level is a class with two properties:
- Type (of type LevelType which is an Enum)
- Description which is a string
I am getting an error:
Object reference not set to an instance of an object.
What am I doing wrong?
Probably this is something simple but I have been around this and I
can't figure out what I am doing wrong.
Thanks,
Miguel