How to Use Entity Framework 6.x in Asp.Net 5 (MVC 6)

前端 未结 5 779
情书的邮戳
情书的邮戳 2020-12-08 10:20

I\'m testing out the new Asp.Net 5, using VS 2015 CTP-6. Because of the lack of features in Entity Framework 7, I would prefer using EF6 for now.

I\'ve tried removi

5条回答
  •  长情又很酷
    2020-12-08 11:07

    Can you not just do this in the startup.cs file? Save creating a factory

    // new context on each request
    services.AddScoped((s) =>
    {
        return new MyContext(Configuration["Data:MyConnection:ConnectionString"]);
    });
    

提交回复
热议问题