WCF Data Services 5.0 (for OData v3) Completed Quickstart Sample

This sample contains the Visual Studio projects that are created when you complete the WCF Data Services 5.0 quickstart. The quickstart helps you become familiar with the Open Data protocol (OData) and WCF Data Services through a series of tasks.

5 Star
24,420 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • Products?
    2 Posts | Last post May 10, 2014
    • Why does the $metadata only return Customer, Order, and Order_Detail?
      Why doesn't this work: http://localhost:<PORT>/Northwind.svc/Products ???
      Products are in the NorthwindEntities. Why are they not exposed?
    • You must explicitly expose entity sets as feeds in the InitializeService method of the data service. The following code in Northwind.svc.cs exposes those three feeds:
            config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead 
                       | EntitySetRights.WriteMerge 
                       | EntitySetRights.WriteReplace); 
                  config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead 
                      | EntitySetRights.AllWrite); 
                  config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead); 
      The wildcard (*) is supported for selecting entity sets:
           config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); 
      This makes it easy to assign accessibility to all entity sets in the data model at once, but I find it's better to set them individually.
  • WCF 5.0 and Entity Framework
    3 Posts | Last post August 17, 2012
    • My old project used entity framework and WCF (WCFDataServices_Mar2011_CTP2), my entity can be exposed but cannot be updated. So I try to replace WCFCTP2 with WCF 5.0, but my entity cannot be exposed now. It looks WCF 5.0 has some problems with entity framework
      I wonder is there a work around for such situation? Thank you!
    • If I call a service operation from a browser I am able to get entities back, but when I consume the service operation in a client app I am not getting back the entities.
    • After I recreate a new project, everything is fine now!
  • Question about sample wcf service consumed on windows phone 7
    2 Posts | Last post July 06, 2012
    • I was wondering is their already a sample for windows phone 7 in which a WCF service is consumed? Or if not can you create a sample or would consuming the one here be about the same?
    • I don't think that there is yet an OData v3 client that supports Windows Phone 7. There is a client for Win8 Metro apps that is included in the Visual Studio 2012 RC (but not Express) on Windows 8.
      I have published other WP7 apps that use the OData v2 client.