How to disable automatic table creation in EF 5.0?

后端 未结 2 1939
囚心锁ツ
囚心锁ツ 2021-02-13 04:07

I installed Entity Framework 5.0 RC for Framework 4.0 in my project. But when I try to get data from Views I get error. EF tries creating table for this entity.

2条回答
  •  花落未央
    2021-02-13 04:42

    Use this on your application startup to turn off database initialization and migrations:

    Database.SetInitializer(null);
    

提交回复
热议问题