I have the following code:
public class Page {
public string FilePath { get; set; }
public int RoleNumber { get; set; }
public class Navigation {
public string Menu { get; set; }
public string Breadcrumbs { get; set; }
}
}
I always need the Navigation class every time a new instance of a Page class is created. Is there a way I can have the Navigation class automatically created?
Looks like it would be best to use inheritance in this case. You don’t want to get into a situation with redundant code.
Alternatively, you could instantiate an instance of
NavigationinPage‘s constructor: