{"id":823,"date":"2012-01-19T13:35:52","date_gmt":"2012-01-19T13:35:52","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/odatateam\/2012\/01\/19\/announcing-odata-t4-for-c-preview-1\/"},"modified":"2024-02-16T13:06:51","modified_gmt":"2024-02-16T20:06:51","slug":"announcing-odata-t4-for-c-preview-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/announcing-odata-t4-for-c-preview-1\/","title":{"rendered":"Announcing OData T4 for C#, Preview 1"},"content":{"rendered":"<p>&#160;<\/p>\n<p>I\u2019m very excited to announce the release of OData T4 for C# Preview 1, for the <a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkID=230482&amp;clcid=0x409\">October 2011 CTP<\/a> of the next version of WCF Data Services libraries, with support for code generation of service operations. The goal of this T4 preview and subsequent ones will be to get community feedback on the templates before having \u201cAdd Service Reference\u201d natively generate T4 templates out of the box in a future release.<\/p>\n<p>Note that support for service operations was added to the T4 because many customers already use it and it has been a regularly requested feature by the community. Having said that, some support for <a href=\"https:\/\/blogs.msdn.com\/b\/astoriateam\/archive\/2011\/10\/17\/actions-in-wcf-data-services.aspx\">actions\/functions<\/a> (which are the way forward for custom operations) will be introduced in an upcoming refresh to the template.<\/p>\n<p>We are looking to refresh the template by first week of February with feedback from the community as well as any bug fixes reported as well as once more by the time WCF Data Services V3 ships<\/p>\n<p>So please give your feedback at our <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/adodotnetdataservices\/threads\">team forum<\/a>.<\/p>\n<p><b><u>How do I Use it? <\/u><\/b><\/p>\n<p>&#8211; Install <a href=\"http:\/\/www.nuget.org\/\">Nuget package manager<\/a><\/p>\n<p>&#8211; Install <a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkID=230482&amp;clcid=0x409\">October 2011 CTP<\/a><\/p>\n<p>&#8211; Add a Service Reference to an OData service<\/p>\n<blockquote>\n<p>o This downloads the metadata<\/p>\n<\/blockquote>\n<p>&#8211; Right-click Add reference-&gt; \u201cManage NuGet packages\u201d <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/4251.image001_thumb_141FA316.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image001\" border=\"0\" alt=\"image001\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/4251.image001_thumb_141FA316.png\" width=\"337\" height=\"183\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<p>&#8211; Search for OdataT4 template<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/3175.image002_thumb_2838BF9F.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image002\" border=\"0\" alt=\"image002\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/3175.image002_thumb_2838BF9F.png\" width=\"587\" height=\"334\" \/><\/a><\/p>\n<p>&#8211; Install OdataT4-CS package<\/p>\n<p>&#8211; This will add a Refrence.tt file in your project<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/0458.image003_thumb_32F616F4.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image003\" border=\"0\" alt=\"image003\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2012\/01\/0458.image003_thumb_32F616F4.png\" width=\"338\" height=\"249\" \/><\/a><\/p>\n<p><b><u>Known Issues, Limitations, and Workarounds<\/u><\/b><\/p>\n<p>&#8211; <i>I get the following error after adding the Nuget package:<\/i> \u201c<i>Running transformation: System.IO.DirectoryNotFoundException: Could not find a part of the path &#8216;&lt;projectDirecotryRoot&gt;Service ReferencesServiceReference1service.edmx&#8217;.T4 has incorrect edmx file path\u201c<\/i><\/p>\n<p>The current template assumes an \u2018$projectRootServiceRefrence1service.edmx\u201d. If your edmx file is in a custom location change the MetadataFilepath property, in Refrence.tt, to point to the correct path.<\/p>\n<p>&#8211; <i>There is no T4 for VB<\/i><\/p>\n<p>We are looking to release our first preview of the VB template at the time of next refresh<\/p>\n<p>&#8211; <i>There is no support for spatial<\/i><\/p>\n<p>Spatial support will be included at end of January refresh<\/p>\n<p>&#160;<\/p>\n<p>Thanks<\/p>\n<p>Ahmed Moustafa<\/p>\n<p>Program Manager<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#160; I\u2019m very excited to announce the release of OData T4 for C# Preview 1, for the October 2011 CTP of the next version of WCF Data Services libraries, with support for code generation of service operations. The goal of this T4 preview and subsequent ones will be to get community feedback on the templates [&hellip;]<\/p>\n","protected":false},"author":512,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odata"],"acf":[],"blog_post_summary":"<p>&#160; I\u2019m very excited to announce the release of OData T4 for C# Preview 1, for the October 2011 CTP of the next version of WCF Data Services libraries, with support for code generation of service operations. The goal of this T4 preview and subsequent ones will be to get community feedback on the templates [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/512"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=823"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/823\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}