Aims360.AspNetCore.OData
9.5.0.1
dotnet add package Aims360.AspNetCore.OData --version 9.5.0.1
NuGet\Install-Package Aims360.AspNetCore.OData -Version 9.5.0.1
<PackageReference Include="Aims360.AspNetCore.OData" Version="9.5.0.1" />
<PackageVersion Include="Aims360.AspNetCore.OData" Version="9.5.0.1" />
<PackageReference Include="Aims360.AspNetCore.OData" />
paket add Aims360.AspNetCore.OData --version 9.5.0.1
#r "nuget: Aims360.AspNetCore.OData, 9.5.0.1"
#:package Aims360.AspNetCore.OData@9.5.0.1
#addin nuget:?package=Aims360.AspNetCore.OData&version=9.5.0.1
#tool nuget:?package=Aims360.AspNetCore.OData&version=9.5.0.1
Aims360.AspNetCore.OData — private fork notes
This folder is a local NuGet feed (registered in the global NuGet.Config as source
Aims360.AspNetCore.OData). It hosts a private rebuild of Microsoft's
Microsoft.AspNetCore.OData package, republished under the package id
Aims360.AspNetCore.OData.
The fork exists for one reason: a custom performance patch to nested $expand
handling that is not present upstream. Everything else is stock Microsoft code.
⚠️ Because this is a fork,
dotnet list package --outdatedand security scanners will not flag it against the official package. It is on you to re-baseline it on each upstream release. See "How to upgrade" below.
Versions
| Package version | Upstream base | Assembly version | Notes |
|---|---|---|---|
9.1.3.1 |
Microsoft.AspNetCore.OData 9.1.3 |
9.1.3.0 | original fork (kept for rollback) |
9.5.0.1 |
Microsoft.AspNetCore.OData 9.5.0 (tag 9.5.0, commit 5bbc8e2) |
9.5.0.0 | current — rebased 2026-07-24 |
The consuming project is
AIMS360APIWebApplications/AIMS360APIMasterDataCore/AIMS360APIMasterDataCore.csproj:
<PackageReference Include="Aims360.AspNetCore.OData" Version="9.5.0.1" />
The assembly name stays Microsoft.AspNetCore.OData (public key token
31bf3856ad364e35) so the package is a binary drop-in — only the package id differs
from Microsoft's.
The patch
File: src/Microsoft.AspNetCore.OData/Query/Expressions/SelectExpandBinder.cs,
method BuildExpandedProperty, immediately before the ProjectAsWrapper(...) call:
// AIMS360 custom patch (ERPDEV): force a Take on expanded collections when no $top is
// supplied ($top null or 0), to avoid slow correlated-subquery SQL plans on nested $expand.
long? expandedTopOption = (expandedItem.TopOption != null && expandedItem.TopOption != 0)
? expandedItem.TopOption
: Int32.MaxValue;
Then expandedTopOption is passed to ProjectAsWrapper in place of expandedItem.TopOption.
Effect: every expanded (navigation) collection gets a Take(...) applied, so the
generated SQL always emits a TOP/FETCH, which avoids the slow correlated-subquery plan
that stock OData produces for nested collections without $top.
Known limitations (by design — same as the original fork):
- The forced
Takeonly takes effect when$topis an allowed query option for that entity set (AllowedQueryOptions.Top). If a set disallows$top, the patch no-ops there. - Only
BuildExpandedPropertyis patched. The sibling call siteBuildSelectedProperty(pathSelectItem.TopOption, for nav/complex projected via a$selectpath) is left as stock, matching the original 9.1.3.1 fork. Patch it too only if a slow query is traced to that path.
The csproj also adds two lines to the first <PropertyGroup>:
<PackageId>Aims360.AspNetCore.OData</PackageId>
<Version>9.5.0.1</Version>
Full diff vs the upstream tag: 2 files, +13/−1.
How to rebuild this exact package
Prereqs: .NET 8 SDK, git.
git clone --branch <tag> https://github.com/OData/AspNetCoreOData.git
cd AspNetCoreOData
git switch -c aims360/<tag>-expand-top-patch
# 1. Apply the SelectExpandBinder.cs patch above (BuildExpandedProperty).
# 2. Add <PackageId>Aims360.AspNetCore.OData</PackageId> and <Version><tag>.1</Version>
# to src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj.
dotnet pack src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj -c Release -o ./_artifacts
# 3. Copy ./_artifacts/Aims360.AspNetCore.OData.<tag>.1.nupkg into THIS folder.
# 4. Clear the stale cache: rm -rf ~/.nuget/packages/aims360.aspnetcore.odata/<tag>.1
Build the
srcproject directly withdotnet pack(as above). Do not use the repo's.Release.nuspec/ CI pipeline — this fork was always packed viadotnet packon the csproj (that's why the nuspec carries exact dependency versions,exclude="Build,Analyzers", a SourceLink<repository commit>, and thePropertyContainer.generated.ttcontentFile).
How to upgrade to a future upstream release
git clonethe new tag andgit rebase/ re-apply the branchaims360/9.5.0-expand-top-patchonto it (the patch is tiny; a manual re-apply is fine if the method moved).- Re-check the
BuildExpandedProperty/ProjectAsWrappercode still matches the shape above. - Rebuild + republish per the section above with the new version (e.g.
9.6.0.1). - Bump the
PackageReferenceinAIMS360APIMasterDataCore.csproj. dotnet restore+dotnet buildthat project (expect0 Error(s)).- Smoke-test a nested
$expandendpoint and confirm the SQL still shows the forcedTOP. - Update the Versions table above. Keep the previous
.nupkgin this folder for rollback.
Rollback: set the PackageReference back to the previous version (e.g. 9.1.3.1),
dotnet restore. The old .nupkg is retained in this folder.
Last rebased: 2026-07-24, onto upstream Microsoft.AspNetCore.OData 9.5.0 (commit 5bbc8e2).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.OData.Core (>= 8.4.0)
- Microsoft.OData.Edm (>= 8.4.0)
- Microsoft.OData.ModelBuilder (>= 2.0.0)
- Microsoft.Spatial (>= 8.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.