@daws could you please clarify more, because I've the same issue and I could not overcome the exception.
Is it possible to use ASP.NET Boilerplate Framework while the entities be database first generated. I already download a template and beginning to work but after 2 hours of coding, I was getting an error that "MyEntity" is n't a TEntity object.