OData / OData/AspNetCoreOData

/$count segment not present on functions returning collection

Open
#396 2 comments 0 reactions 1 assignee View on GitHub

@xuzhg is already working on this.

Since Nov 30, 2021.

documentation investigated question
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a EntitySet and Function bound to Patient EntityType like this:
builder.EntitySet("Patients").EntityType.Collection.Function("GetLookup").ReturnsCollection();

I have PatientsController, with function GetLookup:
[HttpGet, EnableQuery]
public IActionResult GetLookup()
{
return Ok(DataContext.Set());
}

I can access ~/odata/Patients/GetLookup()?$select=Id ... etc queries just fine.

But there isn't ~/odata/Patients/GetLookup()/$count. What is the problem?

Uri convention (https://www.odata.org/documentation/odata-version-2-0/uri-conventions/) states that, Service Operation (which returns a Collection of Entries) should have /$count.

Best regards,
Petko Stoyanov

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.