Note that there are some explanatory texts on larger screens.

plurals
  1. POIDataServiceMetadataProvider - Entities dont show up in $metadata
    text
    copied!<p>I am trying to write our own RIA services provider to expose data from a server that I access via ODBC. I follow th eguidelines set out at <a href="http://blogs.msdn.com/alexj/archive/2010/03/02/creating-a-data-service-provider-part-9-un-typed.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/alexj/archive/2010/03/02/creating-a-data-service-provider-part-9-un-typed.aspx</a></p> <p>I have written our own IDataServiceMetadataProvider / IDataServiceQueryProvider pair and get no errors on what i do.</p> <p>I am putting in a resource set like this:</p> <pre><code>ResourceType tableType = new ResourceType( typeof(Dictionary&lt;string, object&gt;), ResourceTypeKind.EntityType, null, "Martini", table_name, false ); tableType.CanReflectOnInstanceType = false; var prodKey = new ResourceProperty( "Key", ResourcePropertyKind.Key | ResourcePropertyKind.Primitive, ResourceType.GetPrimitiveResourceType(typeof(int)) ); prodKey.CanReflectOnInstanceTypeProperty = false; tableType.AddProperty(prodKey); var prodName = new ResourceProperty( "Name", ResourcePropertyKind.Primitive, ResourceType.GetPrimitiveResourceType(typeof(string)) ); prodName.CanReflectOnInstanceTypeProperty = false; tableType.AddProperty(prodName); _MetaDataProvider.AddResourceType(tableType); _MetaDataProvider.AddResourceSet(new ResourceSet(table_name, tableType)); </code></pre> <p>I see the requests coming in for enumerating the resource sets. I check them there in a breakpoint, and the resource set and the type is there, with all properties.</p> <p>Still, the output I get is:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8" standalone="yes" ?&gt; - &lt;service xml:base="http://localhost:2377/MartiniData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app"&gt; - &lt;workspace&gt; &lt;atom:title&gt;Default&lt;/atom:title&gt; &lt;/workspace&gt; &lt;/service&gt; </code></pre> <p>And for the $metadata version:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes" ?&gt; - &lt;edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"&gt; - &lt;edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="1.0"&gt; - &lt;Schema Namespace="Martini" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2007/05/edm"&gt; &lt;EntityContainer Name="Martini" m:IsDefaultEntityContainer="true" /&gt; &lt;/Schema&gt; &lt;/edmx:DataServices&gt; &lt;/edmx:Edmx&gt; </code></pre> <p>The actual metadata for the types never shows up, no error is shown. pretty frustrating. Anyone any idea?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload