odata

SAP Gateway OData service with LCHR long string

我是研究僧i 提交于 2020-01-01 19:47:20
问题 I am developing a SAPUI5 application consuming oData services with SAP Gateway, where I have implemented a search functionality which is producing a SQL where condition. One part of the condition looks like follows: ... OR DESCRIPTION LIKE '%searchString%'... . In my database table I have a field DESCRIPTION which is of type LCHR length 32000 . The only problem is that the field DESCRIPTION cannot be in WHERE clause. What would be a correct approach of searching long strings in database table

Restlet can't get the data with Android

 ̄綄美尐妖づ 提交于 2020-01-01 19:19:10
问题 I'm going to get data with Restlet of this official OData page: http://services.odata.org/OData/OData.svc/ I've started this tutorial : http://weblogs.asp.net/uruit/archive/2011/09/13/accessing-odata-from-android-using-restlet.aspx My problem is, that at the end, he can't get the metadata . But first: When I'm trying to generate the Restleg-Files (Point 5), the console is showing this, where the lines with are date are red : --------------------------- OData client code generator ------------

How to group SAPUI5 OData before bind to control at client side?

雨燕双飞 提交于 2020-01-01 19:03:13
问题 I have an odata list for example in JSON notation: var data = [ {"category" : "A", "value" : 1, "group" : "x"}, {"category" : "B", "value" : 2, "group" : "y"}, {"category" : "C", "value" : 3, "group" : "x"}, {"category" : "A", "value" : 4, "group" : "y"}, {"category" : "A", "value" : 5, "group" : "x"} ]; First of all I filter against group == x; Values left are: var data = [ {"category" : "A", "value" : 1, "group" : "x"}, {"category" : "C", "value" : 3, "group" : "x"}, {"category" : "A",

How to group SAPUI5 OData before bind to control at client side?

[亡魂溺海] 提交于 2020-01-01 19:02:25
问题 I have an odata list for example in JSON notation: var data = [ {"category" : "A", "value" : 1, "group" : "x"}, {"category" : "B", "value" : 2, "group" : "y"}, {"category" : "C", "value" : 3, "group" : "x"}, {"category" : "A", "value" : 4, "group" : "y"}, {"category" : "A", "value" : 5, "group" : "x"} ]; First of all I filter against group == x; Values left are: var data = [ {"category" : "A", "value" : 1, "group" : "x"}, {"category" : "C", "value" : 3, "group" : "x"}, {"category" : "A",

OData v4 on .Net Core 1.1 missing /$metadata

核能气质少年 提交于 2020-01-01 18:57:07
问题 Using .net Core 1.1, with the Microsoft.AspNetCore.OData libraries, I am able to get an OData endpoint working with my simple controller to perform get, $expand, and other queries. However, I can't get it to return the $metadata to be returned. This question ($Metadata with WebAPi OData Attribute Routing Not Working) is for the same problem, however the .Net APIs have changed since this was posted. Is there a setting, flag, or something else I need to enable? This (http://localhost:52315

Possible to post ODataQueryOptions from the Http Request body?

淺唱寂寞╮ 提交于 2020-01-01 10:02:10
问题 I'm implementing a Web API interface to support some fairly complex queries to run against it and have run up against an issue with the maximum request URI length. The definition of my Web API method looks like this (using Automapper to perform the DTO projections): public IQueryable<ReportModel> Get(ODataQueryOptions<Report> queryOptions) { var query = DbContext.Query<Report>(); return (queryOptions.ApplyTo(query) as IQueryable<Report>).WithTranslations().Project(MappingEngine).To

Using DTO's with OData & Web API

你。 提交于 2020-01-01 08:41:06
问题 Using Web API and OData, I have a service which exposes Data Transfer Objects instead of the Entity Framework entities. I use AutoMapper to transform the EF Entities into their DTO counter parts using ProjectTo() : public class SalesOrdersController : ODataController { private DbContext _DbContext; public SalesOrdersController(DbContext context) { _DbContext = context; } [EnableQuery] public IQueryable<SalesOrderDto> Get(ODataQueryOptions<SalesOrderDto> queryOptions) { return _DbContext

Instantiate new System.Web.Http.OData.Query.ODataQueryOptions in nunit test of ASP.NET Web API controller

风流意气都作罢 提交于 2020-01-01 08:14:34
问题 I have an ASP.NET MVC4 Web API project with an ApiController-inheriting controller that accepts an ODataQueryOptions parameter as one of its inputs. I am using NUnit and Moq to test the project, which allow me to setup canned responses from the relevant repository methods used by the ApiController. This works, as in: [TestFixture] public class ProjectControllerTests { [Test] public async Task GetById() { var repo = new Mock<IManagementQuery>(); repo.Setup(a => a.GetProjectById(2)).Returns

OData Web API Query Interceptor

ぃ、小莉子 提交于 2019-12-31 06:59:07
问题 OData endpoint is created using ASP.NET Web API 2.0 Trying to create a Query Interceptor in the ODataController like shown in the below code: public class AVMItemController : ODataController { ADWAppContext sampleADW = new ADWAppContext("Server=XXX;Database=XXX;User ID=XXX;password=xxx;Trusted_Connection=false;Encrypt=true"); // GET: odata/AVM [EnableQuery(PageSize=25)] public IQueryable<ADWAppContext.AVMItem> GetAVMItems() { return sampleADW.AVMItems.AsQueryable<ADWAppContext.AVMItem>(); }

Odata expand query result by default

本小妞迷上赌 提交于 2019-12-31 04:56:25
问题 Is there a way to auto expand nested entity in the response with odata 5.7? Because by default we have to add ?$expand=myNestedEntity 回答1: In your entity class definition, use the AutoExpand atttribute on the navigation properties you would like to have expanded. 回答2: As an alternative, this can be accomplished with fluent api . builder.EntitySet<MyType>("MyType").EntityType.Expand(SelectExpandType.Automatic, "ExpandedField1", "ExpandedField2"); 来源: https://stackoverflow.com/questions