
.NET
Get flash to fully experience Pearltrees
Beginner's Guide to Reactive Extensions for .NET
Enumeration classes
A common complaint of the Entity Framework is slow insert times for larger datasets. Last night I was trying to insert a catalog of 15k products and it was taking a very long time (I gave up after 5 minutes). I recalled this post a while back from Mikael Eliasson demonstrating SqlBulkCopy using .NET. I had used BCP in SQL server, but not from .NET. I took Mikael’s example and roughed out a reusable generic version below, which produced 15k inserts in 2.4s or +- 6200 rows per second. I upped it to 4 catalogs, 224392 rows in 39s, for +- 5750 rps (changing between 4 files).
SqlBulkCopy for Generic List<T> (useful for Entity Framework & NHibernate)
Introduced in the Effective Test Series , the Expected Object pattern is a technique involving the encapsulation of test-specific logic within a specialized type designed to compare its configured state against that of another object. Use of the Expected Object pattern eliminates the need to encumber system objects with test-specific equality behavior, helps to reduce test code duplication and can aid in expressing the logical intent of automated tests. While the Expected Object pattern is a great strategy for helping adhere to good testing practices, the process of actually implementing the required types can be less than motivating. To alleviate the burden of hand-rolling Expected Object types, I created the Expected Objects library. This library provides the ability to compare the state of one object against another without relying upon the provided type’s equality members.
Introducing the Expected Objects Library | Aspiring Craftsman
The DebuggerDisplayAttribute is a powerful way to customize the way values are displayed at debug time. Instead of getting a simple type name display, interesting fields, properties or even custom strings can be surfaced to the user in useful combinations [ DebuggerDisplay ( "Student: {FirstName} {LastName}" )] public sealed class Student { public string FirstName { get ; set ; } public string LastName { get ; set ; } } The DebuggerDisplay attribute can customize the name, value and type columns in the debugger window. Each one can be customized using a string which can contain constant text or expressions to be be evaluated by the expression evaluator.
Normal Stuff - DebuggerDisplay attribute best practices - jaredpar's WebLog
Retryable actions in C#
Download the Code 2012-10-18 18:00 Edit : I was just informed via Twitter that the source code for this article is no longer available. I had the source on my SkyDrive. I will attempt to find it in the next couple of days.How Duck Typing Benefits C# Developers
C# 4.0/3.0 in a Nutshell - PredicateBuilder
JustDecompile - Free .NET Decompiling Tool
Products > JustDecompile The Free .NET Decompiler for Everyone Quite simply the must-have .NET decompiler for everyone. Now 10 times faster than the leading commercial decompiler.Testing
Some time soon, I want to write about the various Java 7 closures proposals on my blog . However, when I started writing that post I found it was difficult to start off without an introduction to closures. As time went by, the introduction became so long that I feared I'd lose most of my readers before I got to the Java 7 bit. As chapter 5 in the book is largely about anonymous methods and how they provide closures to C#, it seemed appropriate to write this article here. Most articles about closures are written in terms of functional languages, as they tend to support them best. However, that's also precisely why it's useful to have an article written about how they appear more traditional OO languages.
C# in Depth: The Beauty of Closures
Asynchronous Programming
Documentation
The Repository Pattern with Linq to Fluent NHibernate and MySQL | Random Sparks
I have heard a lot of good things about NHibernate, but have never had the opportunity to use it. In this post I will describe how to get started using Fluent NHibernate with Linq to NHibernate using MySQL for a database. Code The Back Story To add a bit of concreteness to the design / code, let’s imagine that we need to build out the back-end for a delivery truck management system.MVC
Secret Project
Well I said I would reveal the secret project I've been working on. 99% of people won't be interested, but if you're a .NET developer you probably will be very interested. Especially if you do a lot of UI work. I actually came up with this idea 6 years ago and wrote a fairly successful codeproject article on it, but then I abandoned it. I've since started a new job, and wished I had this tool, so built it.Prism 4.0 For Visual Studio 2010, .NET Framework 4.0, WPF & Silverlight 4 « Karl On WPF – .Net
The Microsoft patterns & practices team is excited to announce the release of: Prism 4 For Visual Studio 2010, .NET Framework 4.0, WPF & Silverlight 4Table of contents Introduction When using normal C# events, registering an event handler creates a strong reference from the event source to the listening object. If the source object has a longer lifetime than the listener, and the listener doesn't need the events anymore when there are no other references to it, using normal .NET events causes a memory leak: the source object holds listener objects in memory that should be garbage collected. There are lots of different approaches to this problem. This article will explain some of them and discuss their advantages and disadvantages.
Weak Events in C#
WPF - Silverlight

