Returning data from command handlers

This article extends the architectural design of command handlers to allow command handlers to return data.

read more...

- filed under .NET General, Architecture, C#, Dependency injection, O/RM, Simple Injector - No comments / No trackbacks - §

Meanwhile… on the query side of my architecture

Command-query separation is a common concept in the software industry. It is fairly common to model the command side as a message passing system with ‘handlers’ that process such a message. This same concept is equally usable at the query side, but is very uncommon. This article tries to change this. Three simple interfaces will change the look of your architecture… forever.

read more...

- filed under .NET General, Architecture, Dependency injection - five comments / No trackbacks - §

Meanwhile… on the command side of my architecture

This article describes how one simple interface can make the design of your application so much cleaner and flexible than you ever thought was possible.

read more...

- filed under .NET General, Architecture, C#, Dependency injection - one comment / No trackbacks - §

Adding Covariance and Contravariance to the Simple Injector

A few weeks back I read this question on Stackoverflow. The question was about applying covariance / contravariance (or variance for short) to the Autofac dependency injection container. The question triggered me to think about variance support in the Simple Injector. I was wondering whether special changes were needed to the core framework to allow this. However, it didn't take me long to realize that enabling variance is actually pretty easy for anyone using the Simple Injector. The prerequisites are a proper application design and .NET 4.0.

read more...

- filed under .NET General, C#, Dependency injection, Simple Injector - No comments / No trackbacks - §

Faking your LINQ Provider part 2: Optimizing performance with fetching strategies

This sequel explains how to write O/RM specific performance optimizations in such a way that the core business logic won’t be affected. This article builds on top of the foundation described in part 1 and uses the Fetching Strategy design pattern to achieve this goal.

read more...

- filed under .NET General, C#, Dependency injection, Entity Framework, LINQ, LINQ to SQL, O/RM, Simple Injector, SQL - No comments / No trackbacks - §

Simple Injector: Working with multiple constructors

Although limited in features, the Simple Injector has simple but flexible way to add features, such as the possibility to work with multiple constructors.

read more...

- filed under .NET General, C#, Dependency injection, Simple Injector - two comments / No trackbacks - §

Simple Injector - The easiest Dependency Injection framework in town

The Simple Injector is an easy-to-use Inversion of Control library for .NET and Silverlight. It solely supports code-based configuration and is an ideal starting point for developers unfamiliar with larger IoC / DI libraries.

read more...

- filed under .NET General, C#, Simple Injector, Simple Service Locator - No comments / No trackbacks - §

Removing Keyed Registrations from the Simple Service Locator

In this post I again like to consult my Simple Service Locator users, readers of my blog, and followers of the Simple Service Locator CodePlex project, about a change to the library I'm considering.

read more...

- filed under .NET General, Simple Service Locator - two comments / No trackbacks - §

Do we need the Common Service Locator?

The Simple Service Locator has a hard dependency on the Common Service Locator. But is this a good design choice? I like to hear your opinion on this.

read more...

- filed under .NET General, Simple Service Locator - nine comments / No trackbacks - §

Faking your LINQ provider part 1

I recently tried to figure out how to write testable code while using LINQ to SQL as my O/RM of choice, without loosing the ability to use LINQ to Expression trees! In this post I describe the design I ender up with.

read more...

- filed under .NET General, ADO.NET, C#, Databases, Dependency injection, Entity Framework, LINQ, LINQ to SQL, O/RM - twelve comments / No trackbacks - §

Adding Enum Support to Entity Framework LINQ queries

Roger Alsing wrote an interesting post yesterday about adding support for enums to LINQ queries. It is nice to see what Roger is doing with the .NET 4.0 ExpressionVisitor to change Expression trees that allow this behavior. What I dislike however, is that for this solution you need to reimplement all Queryable extension methods. So I thought about this and found a more pleasant way of intercepting query calls.

read more...

- filed under .NET General, C#, Databases, Entity Framework, LINQ, LINQ to SQL, O/RM, SQL - one comment / No trackbacks - §

Using IDataErrorInfo with Validation Application Block

The IDataErrorInfo interface is a core part of the .NET framework and both WPF and ASP.NET MVC use this interface for validation purposes. In this article I will show how to build an abstract base class that implements IDataErrorInfo in a way that Validation Application Block is used under the covers.

read more...

- filed under .NET General, C#, Enterprise Library, Validation Application Block - four comments / No trackbacks - §

Dependency Injection in ASP.NET Web Forms with the Common Service Locator

This article describes how to create and configure a custom PageHandlerFactory class that enables automatic constructor injection for System.Web.UI.Page classes. This keeps your application design clean and allows you to keep the application’s dependency to the IoC library to a minimum.

read more...

- filed under .NET General, C#, Dependency injection, Simple Service Locator - three comments / No trackbacks - §

Mixing Validation Application Block With DataAnnotation: What About SelfValidation?

This article describes how to move the self validation methods of a type to its meta data type, using Validation Application Block 5.0. Using self validation methods inside Data Annotations' meta data type is something that is not supported out of the box.

read more...

- filed under .NET General, C#, Enterprise Library, Validation Application Block - eight comments / No trackbacks - §

Integrating Validation Application Block with ASP.NET part 2

This post describes how to take integration of Validation Application Block with ASP.NET Web Forms to the next level by introducing extension methods that centralize the creation of PropertyProxyValidator controls and enable compile time support. This post build on the code in the previous article and allows users to define value conversions.

read more...

- filed under ASP.NET, C#, Enterprise Library, Validation Application Block - four comments / No trackbacks - §

Integrating Validation Application Block with ASP.NET part 1

This post describes how to take integration of Validation Application Block with ASP.NET Web Forms to the next level by introducing extension methods that centralize the creation of PropertyProxyValidator controls and enable compile time support.

read more...

- filed under ASP.NET, C#, Enterprise Library, Validation Application Block - four comments / No trackbacks - §

CuttingEdge.Conditions source used for MongoDB .NET Driver

Since I built CuttingEdge.Conditions, I had lots of positive reactions from developers who loved it. However, I've never saw the source code been reused in another library or framework; until now.

read more...

- filed under .NET General, C#, CuttingEdge.Conditions - four comments / No trackbacks - §

Breaking changes in SmtpClient in .NET 4.0

In .NET 4.0 the SmtpClient class now implements IDisposable. This is a breaking change what you should watch out for.

read more...

- filed under .NET General - No comments / No trackbacks - §

Protecting against Regex DOS attacks

Bryan Sullivan describes in the May issue of his MSDN article a denial of service attack that abuses regular expressions. As Bryan explains, a poorly written regex can bring your server to its knees.

read more...

- filed under .NET General, Security - No comments / No trackbacks - §

Breaking changes in .NET 4.0

Microsoft published an interesting list of breaking changes in the just released .NET 4.0 framework.

read more...

- filed under .NET General - No comments / No trackbacks - §

Validator inheritance while using Validation Application Block configuration files

This article describes how to build an IConfigurationSource implementation that allows validators, defined in a base class or interface, to be inherited by subclasses and implementations.

read more...

- filed under .NET General, C#, Enterprise Library, Validation Application Block - two comments / No trackbacks - §

Splitting up Validation Application Block configuration into multiple files

This article describes how to build an IConfigurationSource implementation that allows reading multiple configuration files that each contain part of the total Enterprise Library Validation Application Block configuration.

read more...

- filed under .NET General, C#, Enterprise Library, Validation Application Block - two comments / No trackbacks - §

Printer Jam

The last couple of days I've been having a Printer Jam on my way to work.

read more...

- filed under Miscellaneous - one comment / No trackbacks - §

Simple Service Locator - The easiest Inversion of Control framework in town

The Simple Service Locator is an easy-to-use Inversion of Control library that is a complete implementation of the Common Service Locator interface. It solely supports code-based configuration and is an ideal starting point for developers unfamiliar with larger IoC / DI libraries

read more...

- filed under .NET General, C#, Dependency injection, Simple Service Locator - eight comments / No trackbacks - §

CuttingEdge.Conditions in MSDN Magazine Toolbox column

In the November 2009 issue of his MSDN Magazine Toolbox column, Scott Mitchell writes about CuttingEdge.Conditions.

read more...

- filed under CuttingEdge.Conditions - No comments / No trackbacks - §

Vote for Visual Studio Text Editor Guidelines to Return

Visual Studio 2005 and 2008 contain a (not officially supported) feature that allows display of vertical guidelines in the (code) text editor. Visual Studio 2010 however, seems to completely miss this feature. I created a feature request on Microsoft Connect. Please help and vote for this feature to return.

read more...

- filed under Visual Studio - one comment / No trackbacks - §

Sorting entities with the EntitySorter

This article describes the EntitySorter<T> class. It's a nifty little thing that allows the presentation layer to instruct the service layer how collections should be returned.

read more...

- filed under .NET General, C#, Entity Framework, LINQ, LINQ to SQL - two comments / No trackbacks - §

Putting the Validation Application Block configuration in its own file

This article describes how to extract the validation configuration to its own file and allow this to also work with unit tests.

read more...

- filed under Enterprise Library, Validation Application Block - five comments / No trackbacks - §

Integrating Enterprise Library Validation Application Block With LINQ to SQL and Entity Framework Part 4: Using Metadata to Automate Validations

This article describes how to extract information from your generated LINQ to SQL entities to automate validations like maximum string length and disallowing null values.

read more...

- filed under .NET General, C#, Enterprise Library, Entity Framework, LINQ, LINQ to SQL, O/RM, Validation Application Block - No comments / No trackbacks - §

Research on botnets

I just watched an amazing Google Talk video on YouTube that explains how botnets work.

read more...

- filed under Science, Security - No comments / No trackbacks - §

Preventing Cross-site Request Forgery (CSRF) Attacks Using ViewState

This article describes what Cross-site request forgery attacks are and how to mitigate them.

read more...

- filed under ASP.NET, C#, Security - No comments / No trackbacks - §

Microsoft Anti-Cross Site Scripting Library 3.1 released

The Microsoft Anti-Cross Site Scripting Library (Anti-XSS) is an encoding library designed to help developers protect their ASP.NET web-based applications from XSS attacks.

read more...

- filed under ASP.NET, Security - No comments / No trackbacks - §

NDepend

For over three years I've been using NDepend. In this post I'll describe my thoughts on NDepend.

read more...

- filed under .NET General, LINQ - one comment / No trackbacks - §

CuttingEdge.Conditions version 1.0 released

Last week I published the first stable release of CuttingEdge.Conditions.

read more...

- filed under .NET General, C#, CuttingEdge.Conditions, LINQ - No comments / No trackbacks - §

Removing Otherwise method from CuttingEdge.Conditions

In this post I’ll describe another breaking change I’m making to my open source project, CuttingEdge.Conditions.

read more...

- filed under .NET General, C#, CuttingEdge.Conditions, LINQ - No comments / No trackbacks - §

Controversial change in CuttingEdge.Conditions

In this post I’ll describe a controversial change I’m making in my open source project, CuttingEdge.Conditions.

read more...

- filed under .NET General, C#, CuttingEdge.Conditions, LINQ - No comments / No trackbacks - §

The evilness of ApplicationException

This post explains what’s wrong with ApplicationException and why it should not be used.

read more...

- filed under .NET General - two comments / No trackbacks - §

Book: Microsoft .NET: Architecting Applications for the Enterprise.

Last month I read ‘Microsoft .NET: Architecting Applications for the Enterprise’, written by Dino Esposito and Andrea Saltarello. This book is a great piece of work.

read more...

- filed under .NET General, Books - No comments / No trackbacks - §

Free C# 3.0 Pocket Reference ebook

Just found this free ebook on the Red Gate site:

read more...

- filed under Books, C# - No comments / No trackbacks - §

Choosing FxCop rules for Line Of Business applications

Dennis Doomen, architect at Aviva Solutions, published a set of C# 3.0 Coding Guidelines a few months ago. While a lot of different C# coding guidelines can be found on the web, this one caught my attention.

read more...

- filed under .NET General, C# - No comments / No trackbacks - §