For example in my model class
public class Dashboard
{
public Dashboard(Account account)
{
AccountListName = new List<string>();
AccountListName.Add(account.Name);
string AccountName = account.Name;
}
public List<string> AccountListName { get; set; }
public string AccountName { get; set; }
}
When I call the model in my controller.
var model = new DashBoard(account);
the model would contain the AccountListName properly but the AccountName would return null. Why does the AccountName returns null when I bind it to account.Name? Is there any weird interaction with the string type? And how do I fix this issue?