I have to pass an array to my _layout page (which does not have an @model). The array must come from an controller method such as:
public IActionResult AssignLoan()
{
EntityDetails entity = new EntityDetails();
entity.Name = (from o in _context.EntityDetails
select o.Name).ToString();
entity.Name.ToArray();
ViewData["populatedropdown"] = entity;
return View();
}
and the array must be passed to this section of the _layout view and must be set equal to var countries.
var countries = ["Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa"];