views:

101

answers:

0

I was trying to use ajax to retrieve data from a repository using a controller and I kept getting Internal Server Errors... I've whittled it down to the line:

private MyDBEntities _myDB = new MyDBEntities();

That's located in the repository, without that line I don't get the Internal Server Error. The line is called after the Repository is initialized in the controller via

private IMyRepository _repository;

public MyController()
    : this(new MyRepository())
{

}

public MyController(IMyRepository theRepository)
{
    _repository = theRepository;
}

Any ideas of why creating a new instance of an ADO.Net Entity Data Model would throw an Internal Server Error?

The ADO.Net Entity Data Model is located in a separate library called DomainModel. The library is still in the same project as the MVC app, but I'm not sure if it matters that the ADO.Net Entity Data Model isn't in the Models folder of my MVC app.

Any ideas?

Thanks,
Matt