On the ASP.NET MVC team, we occasionally get questions about attributes and how they apply from interfaces to classes, like:
I have an interface IFoo defined like this:
public interface IFoo {
[Required]
string Name { get; set; }
}
And I have a model class defined like this:
public class ConcreteFoo : IFoo {
public string Name { get; set; }
}
Why doesn't the validation attribute from IFoo.Bar apply to ConcreteFoo.Bar?
The difference between base classes and interfaces in the CLR is responsible for this difference.
Continue reading "Interface Attributes != Class Attributes" »

I got a chance to sit down (virtually) with Rob Conery and do my TekPub production, which aimed to show what a real-world TDD session might look like. Rob gave me some vague requirements and then set me off to coding. I know the title says "Full Throttle", but it feels a little three-quarters-throttle to me, mostly because the business area was new to me, and I (purposefully) didn't spend much time thinking ahead about the problem. We wanted this to just be a fresh stab in the dark at implementing something that I knew next to nothing about ahead of time. So, if you're hoping for one of those super-speed katas, then this isn't quite the video for you.
Continue reading "Full Throttle TDD" »
A few months ago, I finished writing part of a book on ASP.NET MVC 3. I was honored to be asked to write the third edition of the book with fellow co-workers Phil Haack and Jon Galloway, and incredibly smart dude K. Scott Allen. This is very good company to be in for a first-time author. :)
The first edition of this book was written by some very impressive people, and it got terrific reviews. The second edition was mostly the same as the first. We took the feedback from the 2nd edition and decided that potential customers would appreciate it if we re-examined the structure of the book and provide as much new content as possible.
Continue reading "Professional ASP.NET MVC 3" »