Monthly Archives: December 2009

Dynamic types and ASP.NET MVC

If you’re using ViewModels in your ASP.NET MVC applications, know that if working with .NET 4.0, you can now create dynamic view models. And it’s actually very simple to do.

Create an ExpandoObject to represent your ViewModel:

 

image

Declare your view to be of type ViewPage<dynamic>

 

image

 

 

 

And you’re done. Here’s the output:

 

image

 

If you’re using ReSharper, you will get Intellisense once you’ve declared a property once (both in the Action as well as the View).

Changes as of January 2010

It’s with a bittersweet feeling that I write this post. As of January, I will no longer be with iMeta Technologies. During my time there, I’ve been involved in some awesome projects, had the privilege of working with some very smart and talented people, and made some great friends. I wish them all the best success in the future.

As of January, I'm starting a new job. I’m going to go back to working from home, something I did for 8 years prior to joining iMeta, so for me it feels like home (pun intended). I have to admit that as much as I liked the office buzz and enjoyed every minute of working with Steve and his eternal ramblings on expression trees, I am happy to not have to face morning and afternoon commutes.

So what’s my new job? Well it comes as no surprise to many to say that I’ve been a fan of a tool called ReSharper for quite some time. I’ve been a member of the JetBrains Academy for a few years and have collaborated with JetBrains at various conference booths. We’ve now decided to formalize the relationship.

I’m very excited to announce that as of January I will be joining JetBrains. My primary role will be to help promote their products on the .NET side, which include ReSharper, dotTrace, as well as cross-platform tools such as TeamCity, YouTrack or WebIDE. As part of my job, I’ll be doing screen casts, blogging, and not only about using the tools, but also focusing on best practices, boosting productivity, etc. As a company that firmly believes in OSS, it also means that I’ll be increasing my participation in OSS projects and actually get to code on things I enjoy!

I’ll be active in the community, continuing to speak at conferences and events, as well as serve as a liaison for JetBrains. I’ll continue to blog on my own site as well as devlicious.

As far as Twitter, we’ll be pushing the Tool-Specific Twitter accounts for ReSharper and dotTrace, so make sure you follow them! You can contact me via my own twitter feed, and of course, don’t forget Ilya, also known as Orangy, ReSharper PM!

With that, all that’s left to say is Happy New Year and we’ll talk in 2010! And don’t start 2010 without ReSharper!

A Follow-up to the UK MSDN Flash Newsletter

I recently wrote a small 500 word article on Behavior Driven Development and
the subtle differences between it and Test Driven Development. However, there
isn’t much you can talk about in 500 words and it makes it even harder if you
can’t really format code or show images. We agreed with Eric Nelson that I would post some images of what I was
referring to in the article, on my blog. The newsletter should go out today, as
such, here is the follow-up post.

Snapshot 1:
Test written using MSpec in C#. The
Establish is used to setup the actual scenario. The
Because is where the actual action takes place. Finally the
It sections are where the assertions happen, where we verify
the behavior.

 



Snapshot 2:
Output of the test run using TestDriven.NET.
It is generated using the class name and the It declarations to
produce a nicely formatted output (removing the underscores)