{"id":4387,"date":"2014-03-30T10:26:51","date_gmt":"2014-03-30T10:26:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-do-i-implement-idataservicemetadataprovider-and-tell-my-data-service-to-use-that-custom-provider-collection-of-common-programming-errors\/"},"modified":"2014-03-30T10:26:51","modified_gmt":"2014-03-30T10:26:51","slug":"how-do-i-implement-idataservicemetadataprovider-and-tell-my-data-service-to-use-that-custom-provider-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-do-i-implement-idataservicemetadataprovider-and-tell-my-data-service-to-use-that-custom-provider-collection-of-common-programming-errors\/","title":{"rendered":"How do I implement IDataServiceMetadataProvider and tell my Data Service to use that custom provider?-Collection of common programming errors"},"content":{"rendered":"<p>\nWe are looking at revising some of the documentation for these interfaces for RTM. In the meantime , to get the Data Services runtime to pick up your IDataServiceMetadataProvider implementation , you will need to implement the IServiceProvider interface on your Data Service class .<\/p>\n<p>IServiceProvider on MSDN<\/p>\n<p>Sample :<\/p>\n<pre><code>public class northwindService:DataService , IServiceProvider \n{\n   public object GetService(Type serviceType) \n   {\n      if (serviceType == typeof(IDataServiceMetadataProvider )) {\n        \/\/return instance of type which implements IDataServiceMetadataProvider \n       }\n     return null;\n    }  \n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We are looking at revising some of the documentation for these interfaces for RTM. In the meantime , to get the Data Services runtime to pick up your IDataServiceMetadataProvider implementation , you will need to implement the IServiceProvider interface on your Data Service class . IServiceProvider on MSDN Sample : public class northwindService:DataService , IServiceProvider [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4387","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4387"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4387\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}