I have 2 Objects, User and Menu, I want to loop into User.Menu to creat links like this:
@for (int i = 0; i < _Usuario.Menu.Count(); i++)
{
@Html.ActionLink( Convert.ToString(_Usuario.Menu.LinkName), Convert.ToString(_Usuario.Menu.ActionName), Convert.ToString(_Usuario.Menu.ControllerName))
}
But i dont have a counter for User.Menu, how could this be done ?
public class User
{
public Int64 Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public DateTime LoginTime { get; set; }
public Menu Menu { get; set; }
public List<string> Objects { get; set; }
public List<string> Controllers { get; set; }
//public List<string> Roles { get; set; }
public User()
{
Objects = new List<string>();
Controllers = new List<string>();
}
}
public class Menu
{
public List<string> LinkName { get; set; }
public List<string> ActionName { get; set; }
public List<string> ControllerName { get; set; }
public Menu()
{
LinkName = new List<string>();
ActionName = new List<string>();
ControllerName = new List<string>();
}
}