The problem is that your User class doesn't contain any UserData variables - so you can't "add" the information to it when you create the class instance.
Think of it like cars: if you want to put your mobile in the glovebox, you have to specify a car first: your car. Then open the glovebox which is part of your car, add your phone, close the glovebox, and then get out of youe car.
in software, that requires three classes:
class Phone : ISmallItem {...}
class Glovebox
{
List<ISmallItem> Contents {get; set;} = new List<ISmallItem>();
}
class Car
{
...
GloveBox GloveBox {get; set;} = new GloveBox();
}
Now you can reference your car, open it's glovebox, insert your phone:
myCar.GloveBox.Contents.Add(myPhone);
Make sense?
So in your example, you need to add a property or field to your User class, to hold teh UserData data:
class User
{
public string Name {get; set;}
public int Age {get; set; }
public UserData UserData {getl; set;}
}
Now your List code will work.
Please notice that I Uppercased yoru properties: that is a the standard for C#, all properties and methods start with an Uppercase letter to differentiate them in code from local variables. It's a good idea to stick with the naming conventions right from the start, as it's much easier to get into good habits than to break bad ones later!