locked
Why doesn't this url work? RRS feed

Answers

  • If you look at the link in each entry in the Products feed, you'll see this:

    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category"
    href
    ="Products(0)/Category" />

    Notice that the type is 'entry', not 'feed', and the name is Category not Categories.

    The query: http://services.odata.org/OData/OData.svc/Products?$expand=Category will expand the single navigation property.

    This is simply the way that the metadata is modeled. It is a one->many from categories->product. So each product has one category. If you take a look at the sample service's $metadata you'll see.

    -Ian

    Wednesday, September 12, 2012 12:04 AM

All replies

  • If you look at the link in each entry in the Products feed, you'll see this:

    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category" type="application/atom+xml;type=entry" title="Category"
    href
    ="Products(0)/Category" />

    Notice that the type is 'entry', not 'feed', and the name is Category not Categories.

    The query: http://services.odata.org/OData/OData.svc/Products?$expand=Category will expand the single navigation property.

    This is simply the way that the metadata is modeled. It is a one->many from categories->product. So each product has one category. If you take a look at the sample service's $metadata you'll see.

    -Ian

    Wednesday, September 12, 2012 12:04 AM
  • thank you - that makes sense.

    Who will win The International Collegiate Programming Championships?

    Wednesday, September 12, 2012 1:02 PM