"If you recall from my previous post Sync’ing OData to Local Storage in Windows Phone (Part 1), I had written a T4 template for my Windows Phone 7.5 (“Mango”) project to generate a proxy client needed to access both an OData service and local database on the device. My template was based on an existing T4 template,which was published in a blog post by Alexey Zakharov on Silverlight Show, that generated a generic OData proxy client. I had promised to publish my first stab a T4 template to generate this hybrid proxy. However, because my original template was based on Alexey’s OSS sample, it was taking a long time to get the go ahead to post it.
A New T4 Template for OData Clients
Fortunately, the other day I heard about a new T4 template written by the OData team to generate an OData client proxy to access an OData v3 data service.
With this new Microsoft-developed template, I have been able to port my previous LINQ-to-SQL additions into a new template without too much work. And, I have now updated my previously published project Using Local Storage with OData on Windows Phone To Reduce Network Bandwidth to now include the actual T4 template. To use this project on your computer, follow the instructions in the main page.
Considerations for My New Hybrid T4 Template
Installing The Hybrid T4 Template into a New Project
In case you want to try out my T4 template in your own Windows Phone project, here’s how you would do it:
One of the key phrases is "...the other day I heard about a new T4 template written by the OData team to generate an OData client proxy to access an OData v3 data service...". This doesn't appear to be out yet, but I'll be keeping an eye open for it.