1

I'm getting

There is already an object named '[table name]' in the database.

First I manually created a table in the database. Then I created a code first entity framework that creates the database and the tables if it is not existing. And it suppose to do nothing when it exist.

Initially I uses MigrateDatabaseToLatestVersion to set my DB using entityframework. Using this I'm expecting that it doesn't need to check every table as long as the DB exist. But then I get that error when accessing.

On the otherhand, I try to use other database and doens't create any table and DB. Meaning entityframework will create the DB itself and not manual. After that everything works fine.

Is it because EF should create the table itself? If no, can it be because of the mapping? Could it be also because of DB access? Or could you give me a sample of a flexible set initialize in EF? :)

4

0 回答 0