Virtual method/property patching with C# dynamic and Castle DynamicProxy

, , , 3 Comments »

One of the things I’ve been doing a lot recently is trying to get some pretty dynamic behaviors out of a fairly strongly typed compile time language. That’s .NET 3.5 of course, and the Castle.DynamicProxy has been an invaluable ingredient.

The other day I saw some neat things like these and more David Ebbo was doing with dynamic in VS2010. Reading up on the new C# dynamic keyword and some interesting bits about IDynamicMetaObjectProvider, DynamicObject, and ExpandoObject to get up to speed – I started to wonder something about ways Castle DynamicProxy and C# dynamic could work together.
Read the rest of this entry »

Spark bits for MVC 2 RC2

, , , 7 Comments »

Title kind of says it all. Spark v1.1 RC1 for MVC 2 RC2.

Thanks to folks who helped getting issues like this sorted out and Ben Scheirman, @subdigital, who sent a pull request on this issue. A while ago Erik Polerecky, @detroitpro, also provided a blog post with some bits you could download that contained those changes.

I asked him afterward if he would be interested in helping update the releases on Codeplex and he kindly agreed, in fact the new bits on codeplex and release notes were put together by Erik, so be sure to thank him for that. Hopefully this is just the first step in getting that larger support base I’ve been angling for. :)

As always – this is a lead up to sticking a fork in some 1.1 bits. If you find anything flaky please email the group or report an issue.

So… Main changes for MVC 2:

  • Updated the MVC binaries
  • Changed use of view context and updated output-capturing
  • Fixed implicit support for areas to be MVC 2 compatible (“area” is in data tokens, not route values)
  • Avoids autoencoding html helper and macro values

The last bit is interesting. In theory you should be able to turn on autoencoding and use ${expr} for all of your output instead of switching to !{expr} for things you know return html. It should “just work” in terms of html encoding data but not markup from things like ${Html.ActionLink(“hello”)}.

Design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in