The IDbCommandInterceptor (sorry, no official documentation) interface was introduced in Entity Framework 6 as part of the new interception and logging API, and allows the interception of the SQL and its parameters that are sent to the database as the result of DbContext CRUD operations.It offers two methods for each of the basic ADO.NET operations, those defined in DbCommand, one called before the operation is executed, and the other called afterwards:
ExecuteNonQuery (UPDATEs, INSERTs, DELETEs) –> NonQueryExecuting, NonQueryExecuted;
ExecuteScalar (SELECTs returning a single value) –> ScalarExecuting,
ExecuteReader (SELECTs returning rows) –> ReaderExecuting, ReaderExecuted.
As usual, the methods ending with “ing” are executed before and those ending with “ed” are executed afterwards, always synchronously.One might naively assume that INSERTs would always trigger a NonQueryExecuting/NonQueryExecuted call, and indeed it is so, unless we have an IDENTITY primary key, in which case, Entity Framework will instead call ReaderExecuting/ReaderExecuted. It’s easy to understand why: when we use an IDENTITY, we need to retrieve the generated value immediately after the INSERT, hence Entity Framework will generate code like:
I have been doing quite a bit of ALM Training recently and have been trying to figure out how best to manage my training VM’s. In the last few months I have taught both the Managing Projects with Microsoft Visual Studio Team Foundation Server 2013 and TFS 2013 Developer Fundamentals a number of times and [...] The post Managing your Azure VM’s with your Phone appeared first on naked ALM - Experts in ALM, TFS & lean-agile with Scrum.
The best basic and scientific calculator for free. Simple and accurate. https://play.google.com/store/apps/details?id=com.calc.scientific
Comment on How to change the StartPage of the Windows Phone 7 Application in Visual Studio 2010 ? by BackgroundImage and Pin to start in Windows Phone 7 using Visual Studio | ...
[…] one of my previous posts , i talked about How to change the StartPage of the Windows Phone 7 Application in Visual Studio 2010 ? and talked bout how we can change the page in the […]
Software OneGet (it’s in the Windows 10 Preview!) – Garrett Serack Announcing PostSharp 4.1 Preview 4: Xamarin Support, and More – Gael Fraiteur Modern.IE Chrome Extension – Leon Liang Updates for the F12 developer tools in the Windows 10 January Technical Preview – Ruben Rios Information Azure WebJobs are awesome and you should start using […]
I was about to pull my hair out. I had been looking at my monitor for nearly an hour, trying to wrap my head around the inverse tree traversal that I had to do. Start at the bottom, work my way up, find my way back to where I started and update each node along […]
Excerpts from the RavenDB Performance team report: Optimizing Memory Comparisons, Digging into the IL
Note, this post was written by Federico. Where I had notes or stuff to extend, I explicitly marked it as such. In the previous post after inspecting the decompiled source using ILSpy we were able to uncover potential things we could do. Did you remember how dotPeek and ILSpy didn’t agree on the last for-loop? dotPeek ILSpy Well to really know which one is right, lets dig deeper. Looks like dotPeek is just too smart for our purposes.
href="http://ayende.com/blog/Images/Windows-Live-Writer/Excerpts-from-the-RavenDB-Performance-te_7935/image_6.png"> MSIL is an stack machine, so everything has to be pushed to the stack to be operated. And the lower you go the less context you have to make optimization choices. The compiler knows a lot more, therefore it can make sensible choices that the JIT can’t. Well this is one of those, the problem here is that the compiler is treating those native memory references in a very “un-native” way, leaving small room to the JIT to do its magic. Therefore we are going to give the compiler a nudge to point him in the...(Read whole news on source site)
With very little around in the way of 4k content I decided to set about creating something for myself and others to enjoy. Of course the project ended up snowballing and has resulted in the release of the “Textures” video (I believe the first commercial 4k release in the UK!). I thought I should write […]