This article is a short demonstration of using Castle DynamicProxy for a somewhat real world application of Aspect-Oriented Programming (AOP). For the sake of this example, imagine, if you will, that you need to count some beans. But not just a few beans, no indeed, you need to count boxes and boxes of beans. For this important task what you need is a dedicated Bean Counter.
Category: Software Development
Logical Operators vs Conditional Logical Operators in C#
You probably already know this, but there is a difference between the logical operators (| and &) and the conditional logical operators (|| and &&). The difference is conditional logical operators short circuit but the logical operators do not.
Extract Interface and Wrap: or How to Mock the Framework
Many .NET framework types, particularly from earlier versions of .NET, aren't implemented in a way that makes the type easy to construct or mock in tests. The same can be said for many third-party libraries that your (legacy) applications may be dependent on upon. To a certain extent this also could apply to your (legacy) code, which in theory could be modified but large changes may be too risky in the time available. For this post I will focus on one particular type that often is the cause of much pain when trying to get code under test, namely System.Data.DataRow
Type Inference and Generic Type Constructors in C#
Recently I read about a handy little trick to get around the 'problem' of constructors for generic types in C# not supporting type inference. The work around involves a helper class with a static generic method.



