How and where to call Database.EnsureCreated and Database.Migrate?

后端 未结 5 2051
栀梦
栀梦 2020-11-28 04:49

I have a ASP.NET MVC 6 application, and i need to call the Database.EnsureCreated and Database.Migrate methods.

But where should I call the

5条回答
  •  [愿得一人]
    2020-11-28 05:24

    Additionally you may see a performance hit if you call this in the constructor of your context... After moving EnsureCreated to the setup.cs utility, I noticed considerable improvements to my response times.

    Note: I am using EFC and UWP.

提交回复
热议问题