The constructor for this controller is returning the error "} expected". Visual studio is not recognizing it as a constructor. Other errors include "method must have a return type".
What is wrong with this code?
namespace blahblah.Controllers
{
public class HomeController : Controller
{
private IUserRepository userRepository;
public HomeController()
{ //} expected here
public Model1Container db = new Model1Container();
this.userRepository = new UserRepository(db);
}
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult About()
{
return View();
}
}
}