wcf-data-services

How to dynamic add filters to a LINQ query against an Odata Source in C#

爱⌒轻易说出口 提交于 2019-12-22 11:09:25
问题 I have a query like the following var query = (from x in NetworkDevices where x.Name == "blabla1" || x.Name == "blabla2" select x ); and i'm running it against an Odata endpoint, so it effectively gets translated into the following URL https://targetserver/endpoint.svc/NetworkDevices()?$filter=Name eq 'blabla1' or Name eq 'blabla2' So i want to dynamically add lots of those where filters... In C# i can just keep adding it to my query, but that isn't dynamic. I want to do it at runtime. If i

How to load children on demand with new jstree v3.0.0

走远了吗. 提交于 2019-12-22 08:23:11
问题 I am looking for like a little bit of help populating children nodes on-demand (on expand) in a jstree. I can populate the parent nodes but having no luck populating the child nodes. Scenario: I am using jstree for populating nodes in a tree. My data source is json. However, i get parent nodes from a different service and child nodes from a different service. I am using the new jstree version 3.0.0 found here: https://github.com/vakata/jstree/zipball/3.0.0-beta8 What challenge I am facing?: I

Building 'flat' rather than 'tree' LINQ expressions

帅比萌擦擦* 提交于 2019-12-22 07:06:20
问题 I'm using some code (available here on MSDN) to dynamically build LINQ expressions containing multiple OR 'clauses'. The relevant code is var equals = values.Select(value => (Expression)Expression.Equal(valueSelector.Body, Expression.Constant(value, typeof(TValue)))); var body = equals.Aggregate<Expression>((accumulate, equal) => Expression.Or(accumulate, equal)); This generates a LINQ expression that looks something like this: (((((ID = 5) OR (ID = 4)) OR (ID = 3)) OR (ID = 2)) OR (ID = 1))

WCF data services (OData), query with inheritance limitation?

喜欢而已 提交于 2019-12-22 05:33:50
问题 Project: WCF Data service using internally EF4 CTP5 Code-First approach. I configured entities with inheritance (TPH). See previous question on this topic: Previous question about multiple entities- same table The mapping works well, and unit test over EF4 confirms that queries runs smoothly. My entities looks like this: ContactBase (abstract) Customer (inherits from ContactBase), this entity has also several Navigation properties toward other entities Resource (inherits from ContactBase) I

Why doesn't IE parse the XML returned from a WCF Data Service?

孤人 提交于 2019-12-21 09:10:19
问题 I am currently running IE8 and am doing some testing with WCF data services. When I make a call to one of my collections in the browser I get the "You are viewing a feed that contains frequently updated content..." message and none of the XML is displayed because it must not understand the Atom content element. However I can easily make this same RESTful call in Chrome or even use Fiddler and see the repsonse just fine. Is there some reason IE cannot parse the XML returned from my WCF data

Post JSON Object to WCF Service Oject always null

守給你的承諾、 提交于 2019-12-21 05:22:21
问题 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 = $("

New oData javascript library (from MSFT) compared to jQuery

蹲街弑〆低调 提交于 2019-12-21 05:14:19
问题 What is the benefit of the new Javascript OData library over using jQuery? http://blogs.msdn.com/b/astoriateam/archive/2011/02/08/new-javascript-library-for-odata-and-beyond.aspx 回答1: jQuery is very good at what it does and datajs doesn't try to duplicate any of its features, so it's hard to answer the question in those terms. datajs currently implements extensive OData support, including multiple formats, support for parsing conceptual models, the ability to enhance results when metadata is

Multiple/Single *.edmx files per database

Deadly 提交于 2019-12-21 04:54:15
问题 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

Request error with WCF Data Services

爱⌒轻易说出口 提交于 2019-12-21 04:29:27
问题 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.

IAsyncRepository or IObservableRepository for silverlight 4 + WCF Data Services

末鹿安然 提交于 2019-12-20 14:44:38
问题 Update 2 : @Enigmativity has a brilliant answer. I've implemented this into a IObservableRepository<T> . Details in my answer below. Question: So I've changed most of the question (See edit history) I would just like it if someone commented/validated/puked on my design. =) So typically my Repos look like this: public interface IRepository<T> where T : class { T GetById(int id); IQueryable<T> GetAll(); void InsertOnSubmit(T entity); void DeleteOnSubmit(T entity); int SubmitChanges(); } But