jin-qu/jinqu-odata

ODataQuery bound actions (with body) and bound functions (with parameters)

Closed this issue · 1 comments

jinqu-odata version

1.1.3

Current behavior

Not available

Proposed behavior

  1. Executing actions bound to entity type using POST
await service.companies()
    .byKey(5)
    .action("Lock")
    .setData(value);
    .executeAsync();
  1. Executing functions bound to entity type using GET, with optional parameters
var result: Contractor = await service.companies()
    .byKey(5)
    .function("GetContractor")
    .withParameters({ country: "USA", revenue: 30000 })
    .executeAsync<Contractor>();

PS. Already implemented in my repository.

Functions without parameters should be called with parentheses.
This is the default behaviour of MS .Net OData services implementation. And this is also the default for Simple.OData.Client.
There is "RouteOptions.EnableNonParenthesisForEmptyParameterFunction" config param in OData services, but it does not cover both cases - only either-either (with XOR without parentheses).