Questions tagged [wcf-data-services-client]

Any application can interact with an Open Data Protocol (OData)-based data service if it can send an HTTP request and process the OData feed that a data service returns. This interoperability enables you to access OData-based services from a broad range of Web-enabled applications. WCF Data Services includes client libraries that provide a richer programming experience when you consume OData feeds from .NET Framework or Silverlight-based applications.

The two main classes of the client library are the DataServiceContext class and the DataServiceQuery class. The DataServiceContext class encapsulates operations that are supported against a specified data service. Although OData services are stateless, the context is not. Therefore, you can use the DataServiceContext class to maintain state on the client between interactions with the data service in order to support features such as change management. This class also manages identities and tracks changes. The DataServiceQuery class represents a query against a specific entity set.

This section describes how to use client libraries to access and change data from a .NET Framework client application. For more information about how to use the WCF Data Services client library with a Silverlight-based application, see WCF Data Services (Silverlight). Other client libraries are available that enable you to consume an OData feed in other kinds of applications. For more information, see the OData SDK.

Read more in the ref.

33 questions
11
votes
3 answers

Proper way to call nested Expand() from .NET OData 4 Client

Problem In an OData 4 service on Web API, what is the proper way to call nested $expand from a .NET client? We are using the OData Client Generator. Back in the prior WCF Data Services with OData 3 service we could call…
8
votes
0 answers

Tips to increase performance of the .NET client data context in WCF data services?

We've been developing a new app using the following stack: SQL Server 2008 R2 -> Entity Framework 4.2 -> WCF Data Services -> WCF Data Services Client Library This is all .NET 4.0 Now, the WCF Data Services Client Library is very convenient for…
Peter Radocchia
  • 10,710
  • 2
  • 34
  • 56
4
votes
4 answers

Entity Framework 6 - DataServiceContext Detect Has Changes

I have a WCF server application running Entity Framework 6. My client application consumes OData from the server via a DataServiceContext, and in my client code I want to be able to call a HasChanges() method on the context to see if any data in it…
Richard Moore
  • 1,133
  • 17
  • 25
4
votes
2 answers

Is there a DataServiceContext.Set(type) equivalent to DbContext.Set(type)

I have recently created a pretty robust API built around Entity Framework's DbContext. I am using a lot of metadata programming and taking advantage of the fact that I can get my data with a call like DbContext.Set(typeof(Customer)). Only, in my API…
3
votes
1 answer

How to POST an entity complete with navigational relationship in Web API OData?

I'm using ASP.NET Web API with OData. I'm trying to POST a Child entity, which has a relationship to a Parent (the parent already exists). When I post the entity (using WCF data service client and SetLink), I can see via Fiddler that it is adding a…
3
votes
1 answer

Best practice for getting single record from WCF DataService Client

I have DataService where T is an EntityFramework DbContext class My client app is a Windows Forms app with a Service Reference. What is the best approach to get a single entity from the service? This code works: var uri = new…
Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
2
votes
2 answers

Are there any events or hooks for DataServiceContext.SaveChanges()

There is no built in property level change tracker in WCF Data Services Client so I have created my own property change tracker. After a caller invokes DataServiceContext.SaveChanges(), I would like to clear my tracked modified properties…
Adam Caviness
  • 3,424
  • 33
  • 37
1
vote
2 answers

DataServiceContext Update Error

I have the following annotated model public class TypeA { public int TypeAId { get; set; } [Required] public TypeB B { get; set; } public string AValue { get; set; } } public class TypeB { public int TypeBId {…
1
vote
1 answer

Error installing WCF Data Service Client for Windows Store Apps

I am working with Windows Store apps. I have backend with WCF Data Services. When I try to add service I have error which says I need to install WCF Data Services Client and put link to http://msdn.microsoft.com/en-us/jj658961. After I downloaded,…
Tomas
  • 1,212
  • 1
  • 9
  • 10
1
vote
0 answers

Batch update using PUT - wcf data services / odata

I have a java odata service which uses PUT to update data. Client is in dotnet. I have an object (order) which has an attribute "list object" (order details). Is it possible to send Order object in one short with order details list using below…
user2463514
  • 273
  • 1
  • 4
  • 19
1
vote
0 answers

WCF Data Services Client: How to select matching entities based on a provided T generic type and a Func?

I'm using the WCF Data Services/Odata client library, and if I target the Northwind sample OData store at http://services.odata.org/Northwind/Northwind.svc/ , with the following instruction I can retrieve the products which have a quantity bigger…
1
vote
1 answer

How can I update entity partly in WCF Data Services

I`m looking how can I update the part of entity via WCF Data Services 5.5, just update several field insted of whole entity. I found several ways. I can update whole entity using context.AttachTo(...); and context.UpdateObject(tp); But…
1
vote
0 answers

Can Delphi XE3 access WCF data services like it does Soap? (without having to Parse the XML manually)

We are about to purchase Delphi XE3, but since installing the demo, I've noticed that I can't add the service reference to the WCF data services. I have tried using the MetaData URL of the service and the base URL of the service with no success. We…
reckface
  • 5,678
  • 4
  • 36
  • 62
1
vote
0 answers

Quality of OData in Mono for Android

I am looking to create some cross platform libraries. One of the most important things for me for my mobile platforms is to access web services. After doing quite a bit of reading, it seems that the best solution would be to write against…
1
vote
1 answer

How do I extract ETAG from a WCF Dataservices response?

I've been trying to get an answer to this question for quite some time. Since the WCF Dataservice isn't thread safe, and often it needs to be recreated, once I query my datastore for a record, how do I extract the ETAG from that response so I can…
1
2 3