Use C# 4.0 dynamic to drastically simplify your private reflection code

Update 8/10/2011: this project now has a home at https://github.com/davidebbo/ReflectionMagic. Also, it is installable via nuget. It’s named ‘ReflectionMagic’.   Private reflection allows you to access private and internal members in other assemblies.  Generally, it’s considered to be a bad thing to do, as it ties you to undocumented implementation details which can later break you. …

15

Take your MVC User Controls to the next level

Note: this is based on ASP.NET MVC 2 RC, and will not work on earlier builds.   The quick pitch: make your User Controls as cool as built-in render helpers! The goal of this post is to show you how to change the way MVC user controls are called from something like this: <%= Html.Partial("~/Views/Shared/gravatar.ascx",…

31

T4MVC 2.6.10: fluent route value API, shorter way to refer to action, and more

To get the latest build of T4MVC: Go to T4MVC page on CodePlex I just posted build 2.6.10.  There were also a few builds in between since I last blogged about 2.6, so this post describes some of those changes (full history here). Fluent route value API As you probably know, T4MVC uses a pattern…

7