odata

Using Delphi to consume oData service recommendations

我们两清 提交于 2019-12-22 08:52:11
问题 I'm about to start a project that requires a Delphi XE Windows 32 client to consume an oData web service. I can query the service correctly with some rough and read test code but it's going to be a slog writing a framework to handle the oData protocol - all the filtering, parameters, etc and handling CRUD operations for all the services. Note that this is the Win32 version of Delphi so I don't have things like linq, etc at my disposal. Are there any Delphi programmers out there that have

Stream support in Odata V4

别来无恙 提交于 2019-12-22 08:45:05
问题 What is the recommended way in handling file stream GET, POST AND DELETE operations. I got following link on how to do it but its for V3 version. While porting this solution to OData V4 Iran into bunch of issues which raised following questions. Is the Stream support is available in Odata V4? If Yes, How do I set HasStream property on IEdmEntityType. The IEdmModel.SetHasDefaultStream seems like deprecated now in V4. Is there any sample which explains how I can go ahead with enabling POST, GET

How to create a dynamic 'contains or LIKE' Expression to be used with Linq against OData service

本小妞迷上赌 提交于 2019-12-22 06:47:37
问题 I'm try'n to create a dynamic query tool using System.Linq.Expressions.Expression (WPF/c#4.0) It runs against an OData Service. So far, all is working as long as I limit the conditions to build in options like Equal(..), GreaterThan(..) etc. There seems to be no build in contains/Like condition so I tried building my own. There are a handful of articles already out there. One I tried is How to create a System.Linq.Expressions.Expression for Like?. Now if I use the above solution, the

How to ignore case using breeze FilterQueryOp

人走茶凉 提交于 2019-12-22 06:22:27
问题 I am using breeze to query data from the server and seem to be running into problems. Is there a way to filter this data and ignore cases or making the value from the field a lower case? Example: var term = "john"; query = query.where("Name", "contains", Term); The problem I am having is if the 'Name' field contains John with capital 'J', It return false but returns true if I change term to 'John'. I know this is case issue but how can I make breeze ignore the casing? without using jquery

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

OData entity property serialization name different than C# variable name

萝らか妹 提交于 2019-12-22 05:23:35
问题 In an ASP .NET Web API using OData, I have a C# object describing the fields allowed to be used in $filter Say I want to limit $filter support to only $filter=deviceId gt 'someValue' (followed http://www.ben-morris.com/parsing-odata-queries-decoupled-data-entities-webapi/ approach...). So I defined a class like this: [DataContract] public class DeviceODataQuery { [DataMember(Name = "deviceId")] public string DeviceId { get; set; } } Then I build myself the OData context because I can't use

How to enable $expand and $select on ODataQueryOptions?

好久不见. 提交于 2019-12-22 05:15:27
问题 The issue started here, where I am unable to call $select or $expand on results . Given: var results = options.ApplyTo(_uow.Repository<ContentType>() .Query() .Get() .Include(u => u.User) .Where(u => u.UserId == userId) .OrderBy(o => o.Description)).Cast<ContentType>() .Select(x => new ContentTypeDTO() { //projection goes here ContentTypeId = x.ContentTypeId, Description = x.Description, UserDTO = new UserDTO { UserId = x.UserId, UserName = x.User.UserName } }); Exception: Unable to cast the

Modify odata results after query

巧了我就是萌 提交于 2019-12-22 05:06:10
问题 I have an ASP.NET Web API app using Entity Framework and Odata. I would like to modify the results of a query when using a GET... currently, within the controller, you effectively just pass the EntityFramework data entities back to the Odata handlers... [EnableQuery] public IQueryable<myEntity> GetLineItem() { return db.myEntities; } It's simple to prepend whatever query Odata passes into this by simply returning a subset return db.myEntity.Where(myEntity => myEntity.Name == "Bob") Odata will

Consume oData service from Delphi

南笙酒味 提交于 2019-12-22 04:11:03
问题 How can I consume a oData webservice from Delphi (I'm trying to interact with the new Bing Search Azure API)? There is almost no information to do this in Delphi. There is a post here but it does not help much explaining how to consume such service from a Delphi point of view. Can anyone provide a simple example? 回答1: Here is a very simple example of consuming an oData service in Delphi XE using the netflix oData service: program oDataDemo; {$APPTYPE CONSOLE} uses SysUtils, msxml, Variants,

Consume oData service from Delphi

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 04:10:05
问题 How can I consume a oData webservice from Delphi (I'm trying to interact with the new Bing Search Azure API)? There is almost no information to do this in Delphi. There is a post here but it does not help much explaining how to consume such service from a Delphi point of view. Can anyone provide a simple example? 回答1: Here is a very simple example of consuming an oData service in Delphi XE using the netflix oData service: program oDataDemo; {$APPTYPE CONSOLE} uses SysUtils, msxml, Variants,