First, ask the Administrator to allow me to count the solution in a few places on the homepage. I have asked this question in the group, and I have to ask for more comments and ideas, at the same time, let's solve a question for everyone.
When using entityframework in combination with web, I found the following problems:
1): If the repository mode is used, generally, each specific repository has a context (objectcontext, or dbcontext) attribute to perform specific data access operations.
2): a page (or a controller/Action), that is, a request, usually faces multiple Repository
3) the cache is not shared among multiple context instances.
--------------------------------------------------------------------------
My problem is:
In the process of using it, is it an httprequest context instance, or is it used to create a new instance every time.
If your policy is: An httprequest corresponds to a context instance, please reply to
If you adopt the following policy: reply to B every time you create a new context instance.
If you adopt other policies, please reply to C.
If you can, please attach your reason (very important)
Thank you.