SelectListViewModel tostring fix
Fix for links in the details to the right controller
This commit is contained in:
@@ -10,7 +10,7 @@ namespace MileageTraker.Web.ViewModels
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Selected > 0)
|
||||
if (Selected.HasValue && Selected.Value > 0 && Available != null)
|
||||
{
|
||||
var selected = Available.FirstOrDefault(i => i.Value == Selected.ToString());
|
||||
if (selected != null)
|
||||
@@ -18,6 +18,10 @@ namespace MileageTraker.Web.ViewModels
|
||||
return selected.Text;
|
||||
}
|
||||
}
|
||||
else if (Selected.HasValue)
|
||||
{
|
||||
return Selected.ToString();
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user