tags:

views:

327

answers:

1

When using RIA services, how do I specify I want to use OData instead of a proprietary format?

+1  A: 

I'm new with Odata but currently works on RIA and I found the article from Brad Abrams blog at

http://blogs.msdn.com/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-exposing-odata-services.aspx

After finished prepare everything such a service, you can specify to use OData by calling URL to the DomainService like

"http://localhost:7777/Sample-App-GreatDomainService.svc/OData/YourObject"

Which,

  1. Sample-App-GreatDomainService.svc = Your domainservice namespace(Mine is Sample.App.GreatDomainService) and followed by .svc (see that '.' replaced by '-')
  2. /OData/YourObject = Exposed to the typename in your data model as OData (Mine is "YourObject" type)

This will get an Atom Feed data of type "YourObject" in your project.

Hop this help. ^ ^