wcf-data-services

Entity Framework 4 & WCF Data Service: N:M mapping

I have three tables in my database: An A table, a B table, and a many-to-many ABMapping table. For simplicity, A and B are keyed with identity columns; ABMapping has just two columns: AId and BId. I built an Entity Framework 4 model from this, and it did correctly identify the N:M mapping between A and B. I then built a WCF Data Service...

How to deal with the limited Linq support of OData (Open Data Protocol)

I have a software, which uses a lot of Linq-to-SQL. Recently, I want to migrate to OData / WCF Data Service architecture. But I met too many problems in the Linq support of OData - it is so limited. I have to modify most of my Linq statements and test them thoroughly again. I am wondering whether there is a system way to solve such a pr...

Can't get the JSONP workin' with WCF Data Services...

What am I missing here? It seems from all that I read and watched, exposing JSON from a WCF Data Service should be as easy as adding the '[JSONPSupportBehavior]' directive in front of the Service Class. Problem is VS2010 doesn't recognize 'JSONPSupportBehavior'. Is there a reference I am missing? Seemed like, from alll the articles, it w...

Is this a bug? : I get " The type ... is not a complex type or an entity type" in my WCF data service using the Reflection provider

When invoking a query on the data service I get this error message inside the XML feed: <m:error> <m:code></m:code> <m:message xml:lang="nl-NL">Internal Server Error. The type 'MyType' is not a complex type or an entity type.</m:message> </m:error> When I use the example described here in the article "How to: Create a Dat...

POX return data from WCF Data Services

I am using WCF Data Services (netfx4) to provide data sourced from SQL via EF, the standard OData mechanism is fine and JSON works as well but I need a third option for generic POX (plain old xml). I have yet to come across a simple strategy or switch that allows me to control this but I am sure one must exist or a workaround method migh...

Should I define a single "DataContext" and pass references to it around or define muliple "DataContext" where ever I end up needing them?

I have a Silverlight application that consists of a MainWindow and several classes which update and draw images on the MainWindow. I'm now expanding this to keep track of everything in a database. Without going into specifics, lets say I have a structure like this: MainWindow Drawing-Surface Class1 -- Supports Drawing DataC...

Learning SQL & Microsoft Data Services stack - Where to start?

I'm trying to learn the Microsoft data / service stack. I want to build a database in SQL Azure and expose it to a c# client application. I've never worked with any SQL database technology. Looking online, everything just seems so confusing -- too many technologies, hard to tell what's new vs what's old. What's the latest technologi...

Difference Between WCF WCF Ria, and Data Service

What is the defference between the WCF Service , WCF Ria Services and the data servics. ...

How to achieve "Blendability" when using DataServiceCollection in my ViewModel

I'm looking at using oData endpoints in my Silverlight client. Naturally, I'm doing MVVM and I want the project to be nice and "Blendable" (i.e. I must be able to cleanly use static data instead of the oData endpoints when in design mode.) Now to the problem. I'd like to use the DataServiceCollection in my ViewModels, since it allows fo...

Authentication on odata service

I want to add some authentication to my odata service. Depending on the user calling i want to: filter rows and/or remove columns. I read in scott hanselmans fine blogpost on odata ( http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx )that it is possible to intercept the incoming queries...

Add custom param to odata url

I want to add some authentication to my odata service. The authorization token i want to include in the url as param so that the url can be used in excel How would one be able to receive and parse any addition param supplied in the url before the odata service does it's thing? (i'm using entitie framework and wcf dataservices) ...

Letting Wcf data service implement another contract

Hi all , I have a wcf data service with the standart configuration . I want to add another functionality to it , so I built a contract interface and let my wcf data service implements it . Now I see in the service the InitializeService method , and the contract interface methods . When I come to connect the service , I get an error , t...

RESTful WCF Data Service Authentication

Hi, I'd like to implement a REST api to an existing ASP.NET MVC website. I've managed to set up WCF Data services so that I can browse my data, but now the question is how to handle authentication. Right now the data service is secured via the site's built in forms authentication, and that's ok when accessing the service from AJAX form...

WCF Data Service: 'No operations found'

I've just built an EF model over a db (Framework 3.5 sp1), and I want to create a WCF Data Service to deploy it. No problem with the entities, but now I've created a service operation like this: [WebGet] public IQueryable<person> PersonsGetAll() { return this.CurrentDataSource.persons; } and I've setted in InitializeService: conf...

Custom OData operation / customize EF model to hide join table in many-to-many relationship

I've got a data model that has two tables with a join table for a many to many relationship & creating an OData service to expose the data for CRUD ops in a Silverlight app. What I'd like to do is abstract the join table from the service. I'm not sure if the best way to do this would be in the model (using EF in .NET3.5SP1) or if I shoul...

Resolving dependency on data model using Autofac

I have run into an issue while creating a data service and using Autofac WCF Integration to resolve a dependency on my data model. Registrations are of the form: builder.RegisterType<MyService>() .InstancePerDependency(); builder.RegisterType<MyModel>() .InstancePerLifetimeScope(); where MyModel has a dependenc...

WCF Data Service returns 400 Bad Request for POST queries

Hi, I need to host a WCF Data service as part of a legacy ASP.NET MVC website running in IIS 7 Integrated mode. Read access to the web service is working fine, but whenever I try to POST to the web service, I get a 400 Bad Request error. For testing purposes, I have downloaded the sample odata service from http://www.odata.org/develop...

ASP.NET together with WCF Data Services or WCF Data Services

Makes it sense to use ASP.NET togehter with WCF RIA Services or WCF Data Services ? Or are these technologies/frameworks only proper for Silverlight primarily ? ...

WCF Data Services SaveChanges(): "Resource not found for the segment"

My line ctx.SaveChanges(); in my controller DutyController.cs throws the following exception when I try to edit my Duty object. System.Data.Services.Client.DataServiceClientException: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"&gt; <code></code>...

How do I edit WCF Data Service objects with ASP.NET MVC 2?

I don't want to put any more code into my controller than I have to. This works: // // POST: /Duty/Edit/5 [HttpPost] public ActionResult Edit(Duty Model) { Duty Attached = (from Duty d in ctx.Duties where d.Id == Model.Id select d).Single(); Attached...