wcf-data-services

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

a 夏天 提交于 2019-12-05 11:19:48
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? Not built in. It's also not currently part of the OData protocol at all (no aggregation is other than count, which we would definitely need to even consider it). The recommended approach is to retrieve all data and do set operations on the client (yuck!). That said, you'd have to

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

戏子无情 提交于 2019-12-05 07:14:29
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 have configured a discriminator, so both Customer and Resource map to the same table. Again, everythings

ADO.Net Services service operation with parameters called from client library fails

浪尽此生 提交于 2019-12-04 19:12:37
Console application var result = dataService.CreateQuery<Customers>("GetCustomerByLastName"). AddQueryOption("lastname", "S"); Service [WebGet] public IQueryable<Customers> GetCustomerByLastName( string lastname ) { return from c in this.CurrentDataSource.Customers where c.LastName.StartsWith( lastname ) select c ; } results in: (relative to http://localhost:1478/Apress.Data.Services.CustomerService.Host/ ) RequestUri: CustomerDataService.svc/GetCustomerByLastName()?lastname=S and fails as a result , because of parentheses in uri , which are not expected. CustomerDataService.svc

How do i Consume WCF Data Service?

别等时光非礼了梦想. 提交于 2019-12-04 17:34:33
i have created a wcf service but i have used 3 projects for it; 1) ServiceLibrary (WCF library) 2) Web 3) ConsoleTestClient my ServiceLibrary app.config file looks like this; <system.serviceModel> <services> <service name="MrDAStoreJobs.ServiceLibrary.AdvertisementService"> <clear /> <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="" contract="MrDAStoreJobs.ServiceLibrary.Interface.IAdvertisementService" /> <endpoint name="mexHttpBinding" contract="IMetadataExchange" binding="mexHttpBinding" address="mex" /> <host> <baseAddresses> <add baseAddress="http://localhost

how to generate client proxy class of a wcf service that will work in the .net 2.0

你离开我真会死。 提交于 2019-12-04 17:29:32
I have to use a wcf service in the ssis script component which is developing in BIDS 2005. For this i have generated the proxy class of that service using svcutil.exe . After attaching the proxy class in the script component it has error of some class such as System.Runtime.Serialization.DataContractAttribute is not defined. Any suggestion how can i resolve this issue.. Or can wsdl is used to genrate proxy class of wcf service. so that it can be used in the .net 2.0. Thanks Finally after much struggling over it, i have resolved the issue. Now i have successfully created the proxy class of the

How would an upgrade from verbose JSON to JSON light affect someone who only looks at the data, and not the metadata?

≡放荡痞女 提交于 2019-12-04 16:43:07
Can anyone explain to me concisely in plain English with a few bullet points what the main differences are between verbose JSON and JSON light for WCF Data Services? I found a document called "JSON light at a glance" by Microsoft, but it's 23 pages long! I don't care about metadata; I only care about the data. I know that JSON light drops the "d" wrapper. Anything else? Are the data types (dates, booleans, etc) sent in the same format? EDIT: I realize that now Microsoft is now calling JSON light simply "JSON", and JSON verbose is the old, deprecated standard. I am calling the new standard

oData WCF Data Services Filter Child Collection

橙三吉。 提交于 2019-12-04 14:49:27
I have an array of customers, each customer has a collection of orders. the query below returns customers and their orders and works as expected: ~Customers?$expand=Orders Now I want to get the existing customers but filter their orders by Order.Amount > 100 (I'm happy for the customers having no such orders to remain in the list), When I'm trying the following: ~Customers?$expand=Orders&$filter=Orders/Amount gt 100 I'm getting the following error: The 'Amount' is not allowed at position ***. Member access or specifying a type identifier on a resource set reference is not allowed. I can loop

How to Host WCF REST Service and WCF Data Service in the same global.asax

依然范特西╮ 提交于 2019-12-04 13:26:54
I have a WCF REST web service that is hosted via a service route in global.asax which looks like this; protected override void RegisterRoutes(System.Web.Routing.RouteCollection routeTable) { routeTable.Add(new ServiceRoute("", new WebServiceHostFactory(), typeof(UserService))); } I am wondering whether or not it is possible to also host another web service (which is a WCF Data Service) in the same application. protected override void RegisterRoutes(System.Web.Routing.RouteCollection routeTable) { routeTable.Add(new ServiceRoute("", new WebServiceHostFactory(), typeof(UserService))); routeTable

Which is better for building an API for my website: MVC or Ado.net data services?

穿精又带淫゛_ 提交于 2019-12-04 08:59:19
I have a website built with MVC, and now I want to build an API for this website, to let users to use this API to implement different website, web services, plugins and browser extensions. I went through this article but didn't get yet which to use. General info about the API I want to build: The user of the API will have a key user name and password to be able to use the API. API will let users add content to my DB after validating this data. API will let users upload images to my server. API need to have friendly URLs. Which technology will fit in my case? Also will help me decide is to know

Breeze not getting metadata automatically

人走茶凉 提交于 2019-12-04 05:29:25
问题 The Breeze documentation says: This [MetadataStore.FetchMetadata] call is made automatically by Breeze just before it attempts to perform it's first query against a remote service But I am making a call like this: function getBags() { var bags; var query = breeze.EntityQuery.from('Bags'); return manager.executeQuery(query).then(querySucceded, _queryFailed); function querySucceded(data) { bags = data.result; logSuccess("Retrieved Bag Data") return bags; } } function _queryFailed(error) {