Visual Studio has code coverage built in, but only if you run VS Premium or better. Sometimes this isn't available, which is what sent me looking for a free alternative. OpenCover fits this goal perfectly. The output isn't as pretty as VS, but no worries. ReportGenerator has integrations with the OpenCover output and creates some... Continue Reading →
SqlTransaction Ain’t Always Transactional (WAT!?!)
Q: "SQL run using a SqlTransaction is part of a SQL Server Transaction and can be rolled back." A) TrueB) False The answer is of course "A", right? That's what I thought too. Basic SqlTransaction Usage Most of us assume that we can write this: using (var con = new SqlConnection("..")) { con.Open(); ... Continue Reading →
Updated version of Monitored Undo Framework released
Today I released an updated version of the Monitored Undo Framework. Changes include: A new parameter on the DefaultChangeFactory's methods for specifying the "description of the change". This can be helpful in cases where the UI shows a list of the undo / redo changes. A new WPF sample that shows, in a simpler codebase,... Continue Reading →
Preventing Inlining for Code that Inspects the Stack Frames
There's a first time for everything. Today, I got to use the attribute that prevents a method from being inlined. There's a good post, including a bit of a warning, on the MSDN forums regarding the issue and solution. In my case, I was looking at the call stack to get the current method, so... Continue Reading →
LinqKit and Dynamically building arbitrarily complex Linq Queries
In some cases, I need to be able to build a query that has a variable set of OR conditions. This is not simple with the default language constructs and extension methods. It’s simple to dynamically build an expression that includes AND parameters, because that is what the WHERE() extension method does. Not so easy for... Continue Reading →