Is there any practical difference between an extension method on <T> or on Object?

Posted by Scott Bilas on Stack Overflow See other posts from Stack Overflow or by Scott Bilas
Published on 2010-06-03T21:46:25Z Indexed on 2010/06/03 21:54 UTC
Read the original article Hit count: 159

Filed under:

Is there any practical difference between these two extension methods?

class Extensions
{
    public static void Foo<T>(this T obj) where T : class { ... }
    public static void Foo(this object obj) { ... }
}

I was poking around in Extension Overflow and I came across the first form, which I haven't used before. Curious what the difference is.

© Stack Overflow or respective owner

Related posts about c#