Entity Framework - OnModelCreating with Model First

后端 未结 2 747
执念已碎
执念已碎 2020-12-21 19:08

I have a Entity Framework model set up with text templates to generate the code. However, one of them creates the DBContext containing an OnModelCreating<

相关标签:
2条回答
  • 2020-12-21 19:54

    Possibly your problem is that the connection string you're using is a standard SQL Server one rather than the Entity Framework one. See this answer.

    0 讨论(0)
  • 2020-12-21 20:05

    You cannot use OnModelCreating when using model first (EDMX). OnModelCreating is only for scenarios without using EDMX.

    0 讨论(0)
提交回复
热议问题