MVC, DbContext and Multithreading

前端 未结 2 664
悲&欢浪女
悲&欢浪女 2020-12-19 14:22

There are lots of questions about these subjects separately and everyone have their own opinion. Maybe someone can give me a good answer regarding the following issue.

2条回答
  •  攒了一身酷
    2020-12-19 14:35

    The DbContext is designed to be instantiated with each request. It implements IDisposable and instantiating is a low-cost operation. Connection pooling to the database is handled internally.

    More Information:

    Entity Framework and Connection Pooling

提交回复
热议问题