Note that there are some explanatory texts on larger screens.

plurals
  1. USMr. Putty
    primarykey
    data
    text
    plurals
    1. COAre you sure you're committing the change in Management Studio? If you're not, this could explain why you're not seeing the results in another session. This behavior could also be caused by the isolation level your EF client is using. I believe the default "read committed" allows non-repeatable reads, but perhaps you're using a different level?
      singulars
    2. COIsn't the problem with overuse of base more that just readability? In my opinion it is really an issue of maintainability and comprehensibility in the larger sense. For example, if you have base everywhere, you have to make changes in potentially many places if, for example, you add an override because now you really don't want base. And the compiler's not going tell you there's a problem. Are you really going to remember this every time???
      singulars
    3. COBut I do want to inject IDisposable objects, and further, I may or may not need to Dispose() of them at the site of injection, depending on configuration. Your first example works when the underlying resource is accessed transiently, but doesn't help if the resource is more persistent. In the second example, it seems odd to me to inject a factory in this way; that is one of the major functions of the IoC model in the first place. If I apply IoC to this concept, I seem to end up back at the original question. I think the container itself needs to participate in this, a la AutoFac.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload