ado-net-dataservices

Can't submit new object to WCF DataService because of Primary Key constraint

I've got a SQL database that uses Guid's for PK's and upon insert, it generates a NewId(). I have an EF data context setup pointing to that database with the primary keys setup with the Entity key:true, Setter:private and StoreGeneratedPattern:Identity because I want the DB to manage the keys and not have code set the PK property. I h...

How to perform insert and update with Ado.net dataservices (EF and Inheritance)

Hi, I have an entity model, in which I have a table per type inheritance. There are 3 types, first, Contact, which I defined as abstract in my EF model and the rest are Company and person types which are derived from contact type. I was trying to insert a person record via the ado.net dataservices and ended up getting the following er...

How can I change the xml:base published by a WCF Data Service?

Hi, I have a WCF Data Service for which I have a custom URL Rewriter so the real url is not visible and I can add special elements in the path for customizing it. For example: http://localhost/Data/ABCD.odata/ Maps to: http://localhost/Data/OneData.svc/ This almost works except that the service is publishing back in the response XML ...

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...

How do I add another return format to WCF data services?

Out of the box WCF Data Services (aka ADO.NET Data Services aka Astoria) supports OData as a return format (xml really, but this is the structure it uses) and JSON. How do I introduce another return format? ...

Can an ASPX CascadingDropDown Extender use a Service Path that is not an ASMX? (WFC SVC or Data Service)

I have noticed that all the example in the internet uses Service Path of ASMX for a cascading dropdown list, is there a way to use more modern technology as it's service path? I was wondering if I could use DataServices for it? ...

Insert New Data using Linq -- WCF Data Services (formerly ADO.NET Data Services)

I am really struggling to insert some data into 2 database tables. I am using Linq over WCF Data Services using Entity Framework 4. The 2 tables look like this: CREATE TABLE [dbo].[Accounts] ( [Id] int IDENTITY(1,1) NOT NULL, [Email] nvarchar(max) NOT NULL, [Password] nvarchar(max) NOT NULL ); CREATE TABLE [dbo].[Employ...

ASP.NET MVC with ADO.NET DataServices

In the project i am working on, i want to use the ADO.NET data services as data access layer. so that other parts of my application (except asp.net mvc web site) could also access it from the same location. I am just not sure if this si the correct model and also for asp.net mvc models I wanted to reuse the data services model, as much a...

Determine request Uri from WCF Data Services LINQ query for FirstOrDefault against Azure without executing it?

Problem I would like to trace the Uri that will be generated by a LINQ query executed against a Microsoft.WindowsAzure.StorageClient.TableServiceContext object. TableServiceContext just extends System.Data.Services.Client.DataServiceContext with a couple of properties. The issue I am having is that the query executes fine against our A...

DataServiceContext.Timeout Property Unit of Time

I am trying to determine what is the unit of time for the ADO.Net Data Services timeout property. MSDN help doesn't identify it: http://msdn.microsoft.com/en-us/library/system.data.services.client.dataservicecontext.timeout.aspx Can anyone confirm what the property value represents? ...

WCF Data Service SaveChanges problem

I've published wcf dataservice project to IIS7 with .NET 4 installed on that server. Everything worked fine, but when i called SaveChanges from client, service returned error: Server Error in '/' Application.Description: An error occurred while accessing the resources required to serve this request. You might not have permiss...

OData - Data Service Simple Authentication

Hello, I would like to add simple authentication to Data Services, for now only to restrict access for particular applications by simple token. I don't need Domain Authentication or Forms authentication. I read a lot about authentication here: http://franssenden.wordpress.com/2010/06/14/custom-security-odata-service-wcf-data-services...

Are protected entity properties in EF 4 a bad idea with data services?

After some NullReferenceException headache from deep down System.Data.Services I found out that data services doesn't like properties in the EF model marked as protected. The exception occurs when the data service is initializing and tries to generate metadata for the EF model. Apparently Microsoft decided to throw a NullReferenceExcept...

DataServices XML to VB Code

I was given XML files I believe were generated from an oData service endpoint with the $metadata url parameter. My question, how do I take these files and generate classes? Or am I thinking about this all wrong? Be advised, these XML files were emailed to me. Cheers! ...

How to do filtering for many entities of many DataServices in one common class?

Hi I have an N-Tier database and every single table has a DataSetId and I absolutely want to be sure that the data is always partitioned correctly. Currently I'm using the QueryInterceptor attribute but it's messy and overly repetitive and prone to errors. Some new Dev could add a new table and forget to filter by DataSetId, or just ren...

DataSource.Table.Where(stringOfConstraint) does not exist in LinqToSQL for OData support?

I'm looking at this Telerik demo, and am unable to get the "count" statement to work. I believe that the following command is only supported on EntityFramework, and not Linq2SQL. return CurrentDataSource.Products.Where(where).Count(); The parameter "where" in lowercase is actually a string that is passed in the ADO.Net DataServices ...