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 - 24 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 - §

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 - fifteen 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 - §

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 - §

Integrating Enterprise Library Validation Application Block with LINQ to SQL and Entity Framework Part 3: The complexity of custom validators.

This article shows the complexity a developer is facing, implementing a custom validator while using an O/RM tool. While the article uses the Validation Application Block and LINQ to SQL in writing the validation logic, the problems encountered in the article are very general.

read more...

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

Integrating Enterprise Library Validation Application Block with LINQ to SQL and Entity Framework Part 2: Using context within custom validators.

This article describes how to write custom validators for the Enterprise Library Validation Application Block, in such a way that it runs within the context of a specific LINQ to SQL DataContext or Entity Framework ObjectContext class, which allows analysis of non-persisted (in-memory) changes in that context.

read more...

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

Integrating Enterprise Library Validation Application Block With LINQ to SQL and Entity Framework Part 1: Basic Integration

This article describes how to integrate the Enterprise Library Validation Application Block in conjunction with an O/RM technology such as LINQ to SQL and Entity Framework.

read more...

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