wcf-data-services

Why would you not use WCF Data Services for querying data?

OK, so we are using entity framework and wish to expose data from these entities to consumers. This data is pretty common and although initially only consumed by WPF applications it could be consumed by other technologies such as Silverlight, ASP.NET, Office, etc in the future. Typically you would build WCF services that expose a number...

OData Save/Validate a Complex Type

I am trying out OData and have a scenario were a customer would like to submit an order. The order will contain/require order items and there is some validation that needs to take place. So say I have Order(customerid, etc...) Order Item (1) Order Item (2) etc... I am curious how to handle this scenario. I've seen examples on how to ad...

How can I tell if a given object has been saved using ADO.NET?

If I have a new object, that is not context.Saved() in ADO.NET, how can I tell that apart from another object that hasn't been saved? I'm going to use this information to determine how to handle my custom autoincrement feature. If the object has been saved to the database, I'll make a roundtrip to the database server. If the object ha...

Dispatcher BeginInvoke Syntax

I have been trying to follow some WCF Data Services examples and have the following code: private void OnSaveCompleted(IAsyncResult result) { Dispatcher.BeginInvoke(() => { context.EndSaveChanges(result); }); } Which is called by the following: this.context.BeginSaveChanges(SaveChangesOptio...

How to host WCF Data Service (OData) in IIS7?

Does anyone know how to host a WCF Data Service (or OData) inside IIS7? I'm seeing lots of articles about hosting WCF, but none specific to WCF Data Service. Thank you very much. ...

ADO.Net DataService Performance Issue

We are using ADO.Net DataService ( .Net Framework 4.0, Visual Studio 2010). We have Select, Insert, Update and Delete operations. For Selecting we have queries like School school = _context.School.Expand("Address, ContactPerson, ContactPerson/Details......").Where(S => S.Name == "xxx").SingleOrDefault(); For Inserting _context.Ad...

ADO.Net Data Services Not Running in Medium Trust

I am trying to build a proof-of-concept on ADO.Net data services for my team, but I seem to be running into issues with my web server's medium trust settings. The data service is simple, just exposing a few tables as an example, and I am not using any service operations. Also, the service is the only endpoint in my project; I am not ru...

Can I validate an entity before saving the changes?

I have a very simple WCF Data Services application and I am doing some basic CRUD operations. I have a ChangeInterceptor on the entity set that is changing, but the object in the ChangeInterceptor is the current state in the database, not what is sent in the HTTP PUT. Is there a way to validate the properties of the object before saving ...

OData Services and Silverlight Client Side Paging, am I missing something?

I've got a silverlight application where I'm using the MVVM approach and retriving data from an oData service. What I'm wanting to do is use the built in data grid and data pager controls to display and move through the returned data. After a couple hours of research, I feel like there is no good built in way to do this. I think it is go...

WCF DataService Data Retrieve Issue

I'm using .net 4.0 (Visual Studio 2008). We are using WCF DataService, through this we are able to update the data. While calling UpdateObject(..) method its working fine and its been updated to database also( I manually checked the database). But while retrieving the data back, its not giving updated value?????? Example : _cont...

DataServiceContext in WPF ViewModels

Hi, So I have a WPF application accessing entities through WCF Data Services. At the moment, I am accessing the proxy class that implements the DataServiceContext directly in my ViewModel. For example: this.context = new MyOwnDataServiceContext(new Uri("http://localhost/myowndataservice")); I then populate entities on the ViewModel f...

How to handle json DateTime returned from WCF Data Services (OData)

I believe I am missing something obvious here. When I request a JSON response from an OData service I get a different result for the DateTime properties than I do when I request XML. I'll use the NerdDinner OData feed as an example. JSON: http://www.nerddinner.com/Services/OData.svc/Dinners(1)?$format=json "EventDate": "\/Date(12357648...

ADO.Net Data Services Update

I'm finding that my svc I've created to use the latest paging update from the ADO.NET update for .NET Framework 3.5 SP1 doesn't seem to work properly and think that it might be that I need to install this update on the server as well as the Build Server. http://www.microsoft.com/downloads/en/details.aspx?familyid=4b710b89-8576-46cf-a4b...

ADO.NET Data Services with EF implementing table per concrete type (TPCT) inheritance

I am working with a SQL data source that has duplicate data in multiple tables. I have no control over the database. For my project, I've created an EF model and an ADO.NET data service (using VS 2008) that exposes it. I also have a .NET client application that consumes the service. Now, these db tables have a large number of fields co...

Silver light web part could not be displayed while using it with ADO.NET service in SharePoint 2010

Hello Everybody, I have created a silver light application which leverages the ADO.NET Data Services in SharePoint 2010 and trying to achieve the CRUD functionality through ADO.NET data service. For that I have added service reference by specifying URL as http://:1111/_vti_bin/listdata.svc to my silver light application in visual 2010. ...

Unable to return custom class from WCF Data Service

I am trying to return a custom class from my WCF data service. My custom class is: [DataServiceKey("ID")] public class Applist { public int ID { get; set; } public string Name { get; set; } } My data service looks like: public static void InitializeService(IDataServiceConfiguration config) { config.RegisterKnownType(typeo...

How to create a computed property in Data Services (OData)?

I am creating an OData service with WCF Data Services using an EDMX. How can I create a computed property for an entity type, so that its value gets computed in the service (C#) and does not come from the database? The value of this property is based on the value of other properties, which are mapped to fields in the database. ...

Can I Perform a 'Distinct' with a WCF Data Service (OData) Query?

I really need to be able to perform a 'DISTINCT' on a WCF Data Service query. From what I can tell, such a function doesn't exist. I know that I can use the Distinct extension method in the Linq query on the client, but it still hydrates the full result set (which isn't what I want in this particular case). Any ideas? ...

WCF / WCF Data Services / WCF RIA Services

Not to add another SO post regarding the different WCF stacks, but I want to make sure I'm heading in the right direction before I waste more development time... My scenario - Our company has a number of web apps that all access the same series of databases. All the apps were basically developed independently, so there's a ton of busine...

Eager loading of collection properties during query execution

Is there a way to eagerly load the child collections of entities fetched in a query without having to specify the paths of the collections as strings in the Expand method? Currently I have the following: foo_entities ctx = new foo_entities(new Uri("http://url/FooService.svc/")); ctx.MergeOption = MergeOption.AppendOnly; ...