Browse by Tags

  • Expressions Cheat Sheet

    I started getting really tired of looking up the translation between the ExpressionType and concrete Expression type (they don’t match up), so I created this cheat sheet that has each ExpressionType, derived Expression type and a simple example. ...
    Filed under:
  • More on Late-Bound Invocations with Expression Trees

    Recently, I went on a bit of a tear in the AutoMapper trying to improve performance.  Besides the threading issues I introduced (dictionary lookups are NOT thread safe, in case you’re wondering), I looked at improving the performance of the reflection...
    Filed under:
  • Strongly-typed Telerik reports

    I absolutely loathe magic strings, especially if all they’re used for is pointing to a member on a type.  Using strings to reference a type member is ridiculously brittle, as any change in the source type member, rename or remove, will not cause...
    Filed under:
  • Adventures with IL Merge

    A recent addition to AutoMapper is the feature where I can map directly to and from interfaces.  You don’t need a concrete type to do this, AutoMapper will create an implementation for you at runtime, with default property behavior.  To do so...
    Filed under: ,
  • Unicode in regular expressions

    Wow, what an interesting blog post title!  Two technologies, each scintillating by itself, when brought together have more energy than a 1988 GnR concert. A feature request came up in AutoMapper to support international characters.  On the surface...
    Filed under:
  • Polymorphism in Expression trees

    While trying to be extra-clever today, I found a potential nasty issue when dealing with strongly-typed reflection .  Suppose I have a simple hierarchy of objects: public abstract class Base { public abstract string Foo { get ; } } public class Child...
    Filed under:
  • Spaces in identifier names in C#

    While I’m a fan of descriptive member names for testcase classes and test methods, there wasn’t a great way to create readable text.  Text in code editors is almost universally monospace, which reads very well for languages with lots of syntax. ...
    Filed under: ,
  • Extension methods and a plea for mixins

    I was having a spot of trouble the other day trying to get my extension methods to show up in my ASP.NET MVC Views.  One of the issues we’ve run into is trying to make our Views (more) intelligent on the HTML they create.  Our Views still only...
    Filed under: ,
  • Piecemeal Expression evaluation

    One of the more interesting uses of Expressions is strongly-typed reflection .  It seems that most of the time dealing with expressions, I never care about ever actually evaluating the expression for any reason.  When all I’m doing is parsing...
    Filed under:
  • Why we need named parameters

    C# 4.0 brings the idea of named parameters to C#.  While optional/default arguments are of questionable value (this is from my VB.NET days), named parameters can really clear up the meaning of a method call.  We’re already faking named parameters...
    Filed under:
  • Making frameworks container-aware

    I’m currently knee-deep in NHibernate custom listeners, for the purpose of adding auditing to our application.  Besides current documentation being plain wrong on the subject (I’ll update on the solution in the future), I hit a rather frustrating...
    Filed under:
  • More C# Attribute annoyances

    And on the subject of the deficiencies of attributes, there are a few more things I’d like to accomplish, but cant.  First on the list, generic attributes: // Boo C# compiler, boo!!! public class GenericAttribute <T> : Attribute So many times...
    Filed under:
  • Dealing with parameters in expressions and strongly-typed reflection

    Something that always bothered me using Expression trees for strongly-typed reflection were the weirdness of doing reflection for methods that return parameters.  Expression trees and reflection go hand-in-hand when doing fluent interfaces/internal...
    Filed under:
  • Beware exceptions in attribute constructors

    If you’d like to have some really wacky bugs, be sure to do something like this: public class BlowupAttribute : Attribute { public BlowupAttribute( int time) { if (time <= 0) throw new ArgumentOutOfRangeException ( "time" , time, "Must...
    Filed under:
  • Functionally dynamic?

    I was just playing with this tonight, but I don’t know it’s worth anything.  I thought of it after some conversations with Matt Podwysocki back at KaizenConf on how do apply some functional ideas in C#.  First, I started with a simple class...
    Filed under:
1 2 3 4 Next >
Copyright Los Techies 2008, 2009. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems