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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aims360.AspNetCore.OData" Version="9.5.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aims360.AspNetCore.OData" Version="9.5.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Aims360.AspNetCore.OData" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aims360.AspNetCore.OData --version 9.5.0.1
                    
#r "nuget: Aims360.AspNetCore.OData, 9.5.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aims360.AspNetCore.OData@9.5.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aims360.AspNetCore.OData&version=9.5.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Aims360.AspNetCore.OData&version=9.5.0.1
                    
Install as a Cake Tool

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 --outdated and 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 Take only takes effect when $top is an allowed query option for that entity set (AllowedQueryOptions.Top). If a set disallows $top, the patch no-ops there.
  • Only BuildExpandedProperty is patched. The sibling call site BuildSelectedProperty (pathSelectItem.TopOption, for nav/complex projected via a $select path) 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 src project directly with dotnet pack (as above). Do not use the repo's .Release.nuspec / CI pipeline — this fork was always packed via dotnet pack on the csproj (that's why the nuspec carries exact dependency versions, exclude="Build,Analyzers", a SourceLink <repository commit>, and the PropertyContainer.generated.tt contentFile).


How to upgrade to a future upstream release

  1. git clone the new tag and git rebase / re-apply the branch aims360/9.5.0-expand-top-patch onto it (the patch is tiny; a manual re-apply is fine if the method moved).
  2. Re-check the BuildExpandedProperty / ProjectAsWrapper code still matches the shape above.
  3. Rebuild + republish per the section above with the new version (e.g. 9.6.0.1).
  4. Bump the PackageReference in AIMS360APIMasterDataCore.csproj.
  5. dotnet restore + dotnet build that project (expect 0 Error(s)).
  6. Smoke-test a nested $expand endpoint and confirm the SQL still shows the forced TOP.
  7. Update the Versions table above. Keep the previous .nupkg in 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.5.0.1 158 8/3/2026
9.1.3.1 713 8/13/2025