odata

How to force jqgrid to query data using OData in query string

一曲冷凌霜 提交于 2020-01-06 02:07:48
问题 Free jqgrid reads remote json data using $.jgrid.useJSON = true; $.extend(true, $.jgrid.defaults, { mtype: 'GET', url: '@Html.Raw(Url.Action("Entity", "API",))' } ); search window is defined using $.extend(true, $.jgrid.search, { multipleSearch: true, recreateFilter: true, closeAfterSearch: true, overlay: 0, recreateForm: true }); If search button is pressed, ugly filters query string parameter is created like http://localhost:52216/admin/API/Entity/DoklstlG?search=true&nd=1448746804617&rows

How to force jqgrid to query data using OData in query string

人走茶凉 提交于 2020-01-06 02:07:29
问题 Free jqgrid reads remote json data using $.jgrid.useJSON = true; $.extend(true, $.jgrid.defaults, { mtype: 'GET', url: '@Html.Raw(Url.Action("Entity", "API",))' } ); search window is defined using $.extend(true, $.jgrid.search, { multipleSearch: true, recreateFilter: true, closeAfterSearch: true, overlay: 0, recreateForm: true }); If search button is pressed, ugly filters query string parameter is created like http://localhost:52216/admin/API/Entity/DoklstlG?search=true&nd=1448746804617&rows

How does one define an (optional) navigation property (?$expand=) in code?

会有一股神秘感。 提交于 2020-01-05 10:29:28
问题 First the explanation and the gist, then the question. So: Let's say I have a view AccountView defined in EF (6.1.1) database first (edmx) so that the code-generated class is //This class is generated from a view by EF (edmx)... public partial class AccountView { public System.Guid Id { get; set; } public int CompanyId { get; set; } } Then I create a partial class in the same namespace ( Entities ) as [MetadataType(typeof(AccounViewMetaData))] public partial class AccounView { //This is added

Microsoft Graph Api: Filter by GUID value

非 Y 不嫁゛ 提交于 2020-01-05 08:16:32
问题 I am trying to use Microsoft Graph Api to get the details of a specific user. I have a problem that can be demonstrated using the Graph Explorer: https://developer.microsoft.com/en-us/graph/graph-explorer If I run this query: https://graph.microsoft.com/v1.0/users I get a list of users, including their ID. I know I can get the details of just one user by appending the id to the url. For example, this query: https://graph.microsoft.com/v1.0/users/f71f1f74-bf1f-4e6b-b266-c777ea76e2c7 Results in

oData v4 - ordering outer entity on property in related one-to-many entities

萝らか妹 提交于 2020-01-05 07:11:20
问题 I have an oData model with a couple of one-to-many relationship, say person->addresses and person->driving-licences. I would like to be able to sort the result set based on properties in the address entity and driving licence entity. As there could be more than one address, I would initially select a single item from the addresses set, based on a property called IsPrimary . As there could be more that one driving licence, I would select the 'UK' driving licence. Is this possible? I was hoping

How to disable Formatters in Web Api OData web service

浪尽此生 提交于 2020-01-05 05:39:08
问题 In my OData Web API web service I'm trying to disable all formatters except XML so that regardless of what the client sends in the Accept header, my web service will always return XML. My controller is derrived from EntitySetController. I think in a pure Web API web service you can just remove the unwanted formatters like in the code below, but it doesn't seem to work in my OData Web Api web service. How can I get it to always return XML? public static class WebApiConfig { public static void

Apostrophe issue in url with OData

余生长醉 提交于 2020-01-05 04:09:26
问题 I am using oData protocol which add the filter criteria in the url E.g. /api/restaurants/getall?$filter=substringof('macdonald',Name) My problem when the value has apostrophe like ( macdonald's ) it will break the url It works fine if I replace it with %26 like macdonald%26 but by adding s ( macdonald%26s ) the url will not work any suggestions? 回答1: When inside the quoted string a single quote can be escaped by doubling it. So in your case it would look like 'macdonald''s'. 回答2: I see this

Can't apply $select when using ODataQueryOptions

两盒软妹~` 提交于 2020-01-04 05:57:22
问题 I am trying to implement querying to Sql Server via EF Core and OData(7.1.0). Action method looks like follows: [HttpGet] public IEnumerable<UserInfoDto> Get(ODataQueryOptions ops) { return this.service.GetUserInfos(ops); } Service code: public List<UserInfoDto> GetUserInfos(ODataQueryOptions ops) { using (var context = new EFContext()) { var query = context.Users.Join(context.Customers, x => x.CustomerId, y => y.Id, (x, y) => new UserInfoDto { Id = x.Id, Name = x.Name, Age = x.Age,

SAPUI5 Data Binding on SimpleForm

感情迁移 提交于 2020-01-04 05:39:09
问题 I am having issues trying to bind data on a simple form. I am using a mock server and have successfully bind data to a list/table My manifest.json looks like this "mock": { "dataSource": "mainService" } My mockdata(UserDetailsSet.json) looks like this [{ "ID_PassNum": "cu001", "Title": "Mr", "Name": "Don", "Surname": "Ownery", "ResType": "SA", "Country": "South Africa" }] My SimpleForm fields looks like this <Label text="Name" /> <Input value="{mock>/UserDetailsSet/0/Name}" /> <Label text=

OData filter by max value and field

久未见 提交于 2020-01-04 05:34:25
问题 The Dataset contains records with following keys: userID, period and points . Is it possible to query one record per period and by max points . Example scenario Dataset [ /* period: 2016-01-01 */ { userID: 1, period: '2016-01-01', points: 100}, { userID: 1, period: '2016-01-01', points: 200}, { userID: 1, period: '2016-01-01', points: 300}, /* period: 2016-01-02 */ { userID: 1, period: '2016-01-02', points: 50}, { userID: 1, period: '2016-01-02', points: 70}, { userID: 1, period: '2016-01-02'