odata

OData v4 error on start-up: Resource not found for the segment 'Whatever'

Deadly 提交于 2019-12-23 08:51:24
问题 I am building out my new v4 service and all was going well until I added a new controller for a new model/entity and got this error when starting the site up for a test run. The controller seems to be correctly coded, just like the others. The path template 'Customers' on the action 'GetFeed' in controller 'CustomersOData' is not a valid OData path template. Resource not found for the segment 'Customers'. What on Earth does that mean? 回答1: This error happens in Web API attribute routing

Using EF and WebAPI, how can I return a ViewModel AND support IQueryable/OData? [duplicate]

给你一囗甜甜゛ 提交于 2019-12-23 07:38:57
问题 This question already has answers here : Web API Queryable - how to apply AutoMapper? (4 answers) Closed 6 years ago . I've got an ASP.NET WebAPI project. I've recently created EntityFramework entities for all my data tables. But I don't want to expose my data layer & schema to my users. How can I map my entities to a ViewModel (automapper?) and provide IQueryable return type so that my API supports OData? OData supports query composition and SQL-like parameters. I guess I'd need to provide

OData.Client returns null

痞子三分冷 提交于 2019-12-23 05:08:09
问题 I am trying to fetch all the data for Customer. However, await mODataClient.For ("Customers").Skip (0).FindEntriesAsync() returns null. I could not able to figure out what I am doing wrong. I am trying to get Northwind Customer data using Simple.OData.Client; private IEnumerable <IDictionary<string,object>> myCustomers; mODataClient = new ODataClient ("http://services.odata.org/Northwind/Northwind.svc/"); try { myCustomers =await mODataClient.For ("Customers").Skip (0).FindEntriesAsync(); }

Debug OData requests

安稳与你 提交于 2019-12-23 04:26:50
问题 I am new to SAPUI5/OData development. So maybe this is a trivial question. To get a better feeling of what is going on I'd like to debug the OData requests executed from my application. How can I do this? My environment: Eclipse with SAPUI5 tools Chrome for debugging Tomcat as Servlet Container. I know how to start debugging tools in Chrome, I found the Network tab but what I wish to see is when the app is performing HTTP calls to the OData Service. 回答1: To debug an SAPUI5 Application, you

OData filter query [closed]

北战南征 提交于 2019-12-23 04:15:08
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I have tables DEPatientVisit and DEPhysician i need to filter the data based parameters 回答1: OData v4 introduces a new operator 'any', which may resolve your scenario. Your request url would looks like: ~/FalconCPDataService.svc/DEPhysicians?$format=json&$expand=DEPatientVisits&$filter

OData filter query [closed]

核能气质少年 提交于 2019-12-23 04:15:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I have tables DEPatientVisit and DEPhysician i need to filter the data based parameters 回答1: OData v4 introduces a new operator 'any', which may resolve your scenario. Your request url would looks like: ~/FalconCPDataService.svc/DEPhysicians?$format=json&$expand=DEPatientVisits&$filter

Error using $expand with NHibernate and webapi + OData

删除回忆录丶 提交于 2019-12-23 03:57:17
问题 When you run the query {{odata-url-prefix}}/ArquivosVenda(2)?$expand=Vendas an error is generated: { "odata.error": { "code": "", "message": { "lang": "en-US", "value": "An error has occurred." }, "innererror": { "message": "Argument types do not match", "type": "System.ArgumentException", "stacktrace": " at System.Web.Http.ApiController.<InvokeActionWithExceptionFilters>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime

Is ODATA using Microsoft Web API really REST architecture?

泄露秘密 提交于 2019-12-23 03:52:21
问题 The more I research about Microsoft framework on ODATA I tend to believe that it is not suited for enterprise application. The framework expects all the database to be directly exposed as ViewModel, even for simple operations like Pagination & sorting. We would be forced to use stasteful mechanism to persist page numbers rendered to the JavaScript client. Or am I not understanding Microsoft implmentation of OData correctly? EDIT-1: Is ODATA V4 a Stateful Architecture? As promoted by Microsoft

Is ODATA using Microsoft Web API really REST architecture?

♀尐吖头ヾ 提交于 2019-12-23 03:52:07
问题 The more I research about Microsoft framework on ODATA I tend to believe that it is not suited for enterprise application. The framework expects all the database to be directly exposed as ViewModel, even for simple operations like Pagination & sorting. We would be forced to use stasteful mechanism to persist page numbers rendered to the JavaScript client. Or am I not understanding Microsoft implmentation of OData correctly? EDIT-1: Is ODATA V4 a Stateful Architecture? As promoted by Microsoft

Is it possible to use ODataQueryOptions with DTO's?

折月煮酒 提交于 2019-12-23 03:43:09
问题 ContentType --> EF model ContentTypes --> DTO In my OData controller: public Task<IQueryable<ContentTypes>> Get(ODataQueryOptions<ContentTypes> options) { var result = options.ApplyTo(_repository.Query().Get() .Where(u => u.UserId == userId) .OrderBy(o => o.Description)) .Cast<ContentTypes>(); return result; } I get an error 500 when trying to apply the ODataQueryOptions . Since the class already inherits ODataController do I even need to do the options.ApplyTo(...) ? 回答1: The solution for