When does Entity Framework open and close Database Connections?

前端 未结 2 1329
无人共我
无人共我 2020-12-09 07:55

When I instance my \"Entities\" object in Entity Framework, and make a couple of queries using that Entities object, what happens to connections?

  • Does it open
2条回答
  •  死守一世寂寞
    2020-12-09 08:17

    The behaviour changed somewhat in EF6, allowing you to pass in open connections or to open the EF connection yourself later. Check out https://msdn.microsoft.com/en-us/library/dn456849(v=vs.113).aspx

提交回复
热议问题