I have looked and not found a specific example of this.
I have a class that has as part of it a list of roles.
public class MenuItem
{
public int Id { get; set; }
public bool Divider { get; set; }
public bool Header { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
public string MenuItemText { get; set; }
public string Title { get; set; }
public IList<string> Roles { get; set; }
public int ParentId { get; set; }
}
In it, it has Public "IList Roles {...}"
I want to add items to a list of MenuItems..
I wanted to use the ".Add" eg:
MenuList = new MenuItemList();
MenuList.MenuItems.Add(new MenuItem(1, "Scheduling", false, true, "Index", "Scheduler", "Scheduling", ??? )
and thats fine for the ints bools and strings but how do I add a list of roles inline to this.. I would like to add a list of roles as part of this ".Add"... line?