Monthly Archives: August 2010

Hydrating Objects With Expression Trees – Part III

To finalize this series on object hydration, I’ll show some performance comparisons between the different methods of hydrating objects. For the purpose of this exercise, I’ll use this class: class SomeType { public int Id { get; set; } public … Continue reading

Posted in 12314, 12721, 13544, 13545, 14278, 14279, 2666, 2673, 2676, 6182 | 2 Comments

Hydrating Objects With Expression Trees – Part II

In my previous post I showed how to hydrate objects by creating instances and setting properties in those instances. But, if the intent is to hydrate the objects from data, why not having an expression that does just that? That’s … Continue reading

Posted in 12314, 12721, 13544, 13545, 14278, 14279, 2666, 2673, 6182 | 2 Comments

Hydrating Objects With Expression Trees – Part I

After my post about dumping objects using expression trees, I’ve been asked if the same could be done for hydrating objects. Sure it can, but it might not be that easy. What we are looking for is a way to … Continue reading

Posted in 12721, 13544, 13545, 14278, 2666, 2673, 6182, 7656 | 2 Comments

Mastering Expression Trees With .NET Reflector

Following my last post, I received lots of enquiries about how got to master the creation of expression trees. The answer is: .NET Reflector On that post I needed to to generate an expression tree for this expression: Expression<Func<object, object>> … Continue reading

Posted in 12314, 12721, 13544, 13545, 14278, 14279, 2666, 2673, 6182, 7656 | 1 Comment

Dumping Objects Using Expression Trees

No. I’m not proposing to get rid of objects. A colleague of mine was asked if I knew a way to dump a list of objects of unknown type into a DataTable with better performance than the way he was … Continue reading

Posted in 12314, 12721, 13544, 13545, 14278, 14279, 2666, 2673, 6182 | 2 Comments

C#: More On Array Variance

In a previous post, I went through how arrays have are covariant in relation to the type of its elements, but not safely covariant. In the following example, the second assignment is invalid at run time because, although the type … Continue reading

Posted in 13544, 2666, 2673 | Leave a comment