MVC 3 Code Samples for TriNUG

Thanks to everyone who attended my presentation last night at TriNUG [http://trinug.org/]. The code samples as PowerPoint can be downloaded here [http://archive.msdn.microsoft.com/michelotti/Release/ProjectReleases.aspx?ReleaseId=5607] ....


Leverage T4Scaffolding for WCF Web API

MvcScaffolding [http://mvcscaffolding.codeplex.com/] is a tremendous productivity improvement for MVC developers. Earlier this year, Steve Sanderson posted the definitive 7-part series on MvcScaffolding [http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/] which is a must-read for anyone serious about doing scaffolding. The best part about the scaffolding infrastructure is that MvcScaffolding is actually built on top of another package...


Documenting Link Relations with Web API

In a previous post, I talked about how to build your own custom Media Type Formatter [http://geekswithblogs.net/michelotti/archive/2011/06/06/understanding-custom-wcf-web-api-media-type-processors-on-both.aspx] with the WCF Web API. In this post, I used HAL [http://restafari.blogspot.com/2010/10/evolving-hal.html] as the media type to expose an API for Nerd Dinner. There are a core set of guiding principles to building RESTful services [http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyper...


Understanding Custom WCF Web API Media Type Formatters on Both Server and Client

Media Type Formatters in the WCF Web API provide a way for the consumer of your service to not only specify the format they want for their response, but also specify the format they are using on their request. Typically the desired response format is specified in the "Accept" request header and the request body format is specified in the "Content-Type" request header. Media types are central to building any RESTful service. Two of the most common media types are "application/xml" and "applicatio...


Resolve 404 in IIS Express for PUT and DELETE Verbs

IIS Express is a new web server that replaces the old Visual Studio web server (aka Cassini).  IIS Express provides a number of benefits which you can read about here [http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx] and they key aspect is that it is IIS. However, that's not to say that there aren't any gotchas. One of the things that I ran into recently was that I was getting a 404 when trying to use the PUT and DELETE verbs (which are commonly used in RESTful se...