I managed some time to stab the new ASP.NET WebAPI, I have developed few Http API in the past solely on ASP.NET MVC instead of going through the WCF route. My goal was to check how much work I can delegate it to the new WebAPI instead of doing it myself. No, I am not going to show you some CRUD controller that does the basic stuffs, I take it for granted. Instead, I would show you something that is more realistic. The example that I am going to present a Contact resource that has id, first name, last name and a collection of associated addressed, still pretty basic stuff.
Recently I was trying intermixing the new .net 4 dynamic object with the regular object, the idea is to add dynamic properties in regular object, the regular object may have some predefined properties and additional properties can be added at runtime, before the release of dynamic object we usually handle these kind of cases with the
dictionary. With the new dynamic object, your regular object can directly inherit from the
DynamicObject to achieve this, but I want to keep my class hierarchy clean, so I created a new interface that inherits from