code first CTP5 error message
Posted
by
user482833
on Stack Overflow
See other posts from Stack Overflow
or by user482833
Published on 2011-02-21T23:14:50Z
Indexed on
2011/02/21
23:25 UTC
Read the original article
Hit count: 503
I get the following error message with a new project I have set using code first CTP5. Can't find anything on the web about it. Has anyone encountered this error message?
The context cannot be used while the model is being created.
This occurs the first time my database context is called (code below):
using (StaffData context = new StaffData()) { return context.Employees.Count(e => e.EmployeeReference) == 1; }
At this point the database has not been created. I have a database initialiser DropCreateDatabaseIfModelChanges which I set in app_start.
© Stack Overflow or respective owner