[Solved] Unable to instantiate Object in ASP.NET [closed]


It is invalid to assign an access modifier to a local variable hence the error.

You need to remove the private access modifier from the local variable.

public ActionResult Index()
{
  Repository repository = new Repository();
  return View(repository.Reservations);
}

1

solved Unable to instantiate Object in ASP.NET [closed]