wcf-data-services

Resource not found for segment 'Property'

 ̄綄美尐妖づ 提交于 2019-12-03 23:25:44
When using ADO.Net Data Services client to refresh an entity by calling the LoadProperty : ctx.BeginLoadProperty(this, "Owner", (IAsyncResult ar) => ... It throws an error on the server if the property is null Error: Exception Thrown: System.Data.Services.DataServiceException: Resource not found for the segment 'Owner'. at System.Data.Services.RequestDescription.GetSingleResultFromEnumerable(SegmentInfo segmentInfo) at System.Data.Services.DataService1.CompareETagAndWriteResponse(RequestDescription description, ContentFormat responseFormat, IDataService dataService) at System.Data.Services

Linq query error

不打扰是莪最后的温柔 提交于 2019-12-03 21:47:45
问题 I am using following Linq query: from p in People where p.Name == "George Lucas" select p.TitlesActedIn where TitlesActedIn is a list. People and TitlesActedIn are associted But I am getting error: InvalidCastException: Unable to cast object of type 'System.Linq.Expressions.PropertyExpression' to type 'System.Data.Services.Client.ResourceExpression'. Please suggest solution. 回答1: A very simple way to do it: var query = People .Expand("TitlesActedIn") .Where(p => p.Name == "George Lucas")

How to Improve WCF Data Services Performance

会有一股神秘感。 提交于 2019-12-03 18:34:40
问题 I'm new to WCF Data Services so I've been playing. After some initial tests I am disappointed by the performance of my test data service. I realize that because a WCF DS is HTTP-based there is overhead inherent in the protocol but my tests are still way slower than I would expect: Environment: All on one box: Quad core 64-bit laptop with 4GB RAM running W7. Decent machine. Small SQL database (SQLExpress 2008 R2) with 16 tables... the table under test has 243 rows. Hosted my test service in

Post JSON Object to WCF Service Oject always null

自作多情 提交于 2019-12-03 17:30:59
Am having trouble with a 'post'.am getting User Object always null.. Im at my wits end and have been researching this for days, so if anyone has any ideas, please help! Thanks in advance My Jquery looks like this $(document).ready(function () { $("#register").click(function (e) { e.preventDefault(); //stop the submit event for the submit button var Name = $("#register_username").val(); var Email = $("#register_email").val(); var Password = $("#register_password").val(); var Contact = $("#register_contactNumber").val(); var Adress = "Seteelte Town"; var chkUserType = document.getElementById(

Entity Framework and sharded database

耗尽温柔 提交于 2019-12-03 15:58:16
I have a WCF Data Service running on top of a Entity Framework code first 4.1 provider. The database is quite large (one key table has 77+ million records and grows by ~10% per month) and has presented quite a performance problem. While sharding a database that large is a pain it seems inevitable. My question is, has anybody successfully implemented EF with a sharded database and, if so, do you have any guidance? Have you investigated the following options: Clustering your DB (I assume it's SQL Server you are using)? Extracting some of your data (archived records, for example) into another

Multiple/Single *.edmx files per database

江枫思渺然 提交于 2019-12-03 15:09:13
I have a project that interacts with a database through ADO.net Data Services. The database is large ( almost 150 tables with dependencies ). The project started a few years ago and there were DataSets used then; now we're moving towards entity model relationships. The model is growing since we are adding more tables we need to work with. Is this a right way to manage all that?. Meaning should I have a SINGLE database model file to have single data context? What are drawbacks and how do you use the entity framework with large databases (or should it not be used with large ones? The

Request error with WCF Data Services

北慕城南 提交于 2019-12-03 13:20:33
Its my first time setting up an OData Service and I'm of course having some problems... The problem is that I can't get the service running, I keep getting an "Request Error". I have researched on what the problem can be and I found that a common issue is that the access rules are incorrectly typed. So I have tried fixing this both with Singular names, Plural names and I have also tried with typeof(Post).getType().Name Well here is my code. I hope you can help me, I've been stuck for hours. public class ODataService : DataService<Entity> { // This method is called only once to initialize

How to disable authentication schemes for WCF Data Services

人走茶凉 提交于 2019-12-03 13:12:22
问题 When I deployed my WCF Data Services to production hosting I started to get the following error (or similar depending on which auth schemes are active): IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used. Apparently WCF Data Services (WCF in general?)

How do I choose between WCF, REST, POX and RIA services for a new Silverlight application

泪湿孤枕 提交于 2019-12-03 04:17:31
问题 There a lot of different ways a Silverlight application can connect back to it’ server. Including WCF - Windows Communication Foundation REST (see also) ADO.NET Data Services (or is this just REST?) POX - Plain Old XML (E.g basic xml) RIA services For each of these please say what it’s for and when you would or wouldn’t use it. I am not looking for a great level of details just a set of “rules of thumb” for choosing between them. (The problem is when designing your first Silverlight

Enable WCF Data Service to accept/return JSON by default

核能气质少年 提交于 2019-12-03 01:51:08
I have a WCF Data Service that I'd like to return JSON by default for all operations. Is there a place I can set that in configuration/via service attributes? In order to enable json via the $format tag like this: host:8038/YourService.svc/?$format=json Add this attribute to your service declaration: [JSONPSupportBehavior] public class Service : DataService<YourEntities> Add this as a class to your service: using System; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.Text; using System.Xml