Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

New Post: Code review of E

$
0
0
@IDisposable
  1. I’ll bring this up in the design meeting and see what the rest of the team feels.
  2. If you want to use an interface where you have control then you can do that by implementing IDbCommandInterceptor. I have a blog post that I plan to put up tomorrow that shows this. There is pretty strong feeling that the Log property should not be changed in any way that makes it more work to use. Even the change from a TextWriter to a delegate was debated and some felt it went too far. Since EF 4.1 we have been attempting to develop lower-level building blocks that provide flexibility and power while at the same time adding convention-based higher-level services that are easy to use, have low concept counts, and do what we believe most people want. The Log property is one of these higher-level services. If it doesn’t fit your needs then the lower-level IDbCommandInterceptor is the way to go. Form everything I have read in your comments it seems like IDbCommandInterceptor does what you want, so if I’m missing something about how this doesn’t work for you then feel free to explain more.
  3. This is a somewhat interesting idea, although given the way interception contexts are designed to be used it would not make any practical difference. It would only make a difference if attempting to go from a result context for one type of operation to the result context for a different type of operation, which a) doesn’t really make sense and b) is never going to be possible with the current interception contexts used by EF anyway.
  4. This is an interesting point. The idea that the code calling the public dispatch method would use the interception context after making the call was something I had not considered. It’s certainly not the intention of this code. I'll have a bit more of a think about this.
  5. The intention is that if an interceptor sets the Result, then EF will not change that value. Is there a case where this is not true? If an exception is thrown, then the Result also will not be set and will remain the default value. An Executed method could still set this value, and this could be observed by other interceptors, but this doesn’t seem like a problem.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>