Complete explanation and examples can be found here: http://geekswithblogs.net/michelotti/archive/2011/07/14/leverage-t4scaffolding-for-wcf-web-api.aspx.