Cargoflash.RevenueForge.Shared.Exporting 1.0.2

dotnet add package Cargoflash.RevenueForge.Shared.Exporting --version 1.0.2
                    
NuGet\Install-Package Cargoflash.RevenueForge.Shared.Exporting -Version 1.0.2
                    
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="Cargoflash.RevenueForge.Shared.Exporting" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cargoflash.RevenueForge.Shared.Exporting" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Cargoflash.RevenueForge.Shared.Exporting" />
                    
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 Cargoflash.RevenueForge.Shared.Exporting --version 1.0.2
                    
#r "nuget: Cargoflash.RevenueForge.Shared.Exporting, 1.0.2"
                    
#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 Cargoflash.RevenueForge.Shared.Exporting@1.0.2
                    
#: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=Cargoflash.RevenueForge.Shared.Exporting&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Cargoflash.RevenueForge.Shared.Exporting&version=1.0.2
                    
Install as a Cake Tool

Cargoflash.RevenueForge.Shared.Exporting

Generic "export the grid to Excel" framework for Cargoflash RevenueForge microservices — published as a single NuGet package. One generic AppService + one small per-module adapter interface, instead of a hand-written ExportXxxAsync for every grid.

What's in this package

  • IExportDataProvider — the one interface a microservice implements per exportable grid. Delegates to that module's already-existing paged repository methods; no query logic is duplicated here.
  • ExportRequestDto — same FilterGroups/SortField/SortOrder shape every Grid endpoint already accepts, plus ModuleKey to select the provider.
  • ExportAppServiceBase — ExportAsync(ExportRequestDto) (decides instant vs. background by row count), GetExportStatusAsync(token), DownloadAsync(token).
  • GenericExportExecutor — shared by both the instant and background paths: streams rows from the resolved IExportDataProvider straight into MiniExcel (never buffers the full result set) and stores the result in blob storage keyed by a download token.
  • ExportBackgroundJob — an ABP background job (no Quartz/Hangfire) for exports over the configured row threshold.
  • AbpExportingOptions — InstantExportRowThreshold (default 2000), PageSize (default 5000), DownloadTokenLifetime (default 30 minutes). Override via Configure<AbpExportingOptions> in your own module if the defaults don't fit.
  • FilterGroup / FilterCondition / FilterMatchMode — a package-local copy of the filter shape already used by every Grid endpoint, so this package never references a specific microservice's Contracts project. Map to/from your module's own local types inside your IExportDataProvider implementation.

What's deliberately NOT in this package

No SignalR, no ABP Notification module wiring, no read-replica routing, no distributed event bus — none of that is needed for a single microservice to expose a generic export endpoint. Add it in your own module later if a specific need shows up.

Install

dotnet add package Cargoflash.RevenueForge.Shared.Exporting
[DependsOn(typeof(CargoflashRevenueForgeSharedExportingModule))]
public class YourServiceModule : AbpModule { ... }

This package does not pick a BlobStoring provider for the "cargoflash-exports" container — that's your service's call, since you already reference whichever provider package it uses. Add this once, in your own module's ConfigureServices (example for the Database provider, already referenced by every current consumer via Volo.Abp.BlobStoring.Database.EntityFrameworkCore):

Configure<AbpBlobStoringOptions>(options =>
{
    options.Containers.Configure<ExportBlobContainer>(container => container.UseDatabase());
});

Quick example

public class CountryExportDataProvider : IExportDataProvider, ITransientDependency
{
    private readonly ICountryRepository _repository;
    private readonly IPermissionChecker _permissionChecker;

    public string ModuleKey => "Country";

    public async Task CheckExportPermissionAsync()
    {
        if (!await _permissionChecker.IsGrantedAsync(CountryPermissions.Default))
        {
            throw new AbpAuthorizationException("Not permitted to export Country.");
        }
    }

    public Task<long> GetCountAsync(List<FilterGroup>? filterGroups, CancellationToken ct)
        => _repository.GetCountAsync(MapFilters(filterGroups), ct);

    public async IAsyncEnumerable<object> GetRowsAsync(
        List<FilterGroup>? filterGroups, string? sortField, string? sortOrder, int pageSize,
        [EnumeratorCancellation] CancellationToken ct)
    {
        var mapped = MapFilters(filterGroups);
        var skip = 0;
        List<Country> page;
        do
        {
            page = await _repository.GetListAsync(mapped, sortField, sortOrder, pageSize, skip, ct);
            foreach (var country in page)
            {
                yield return new CountryDto { /* map fields */ };
            }
            skip += pageSize;
        } while (page.Count == pageSize);
    }

    private static List<YourModule.FilterGroup>? MapFilters(List<FilterGroup>? filterGroups) { /* 1:1 field mapping */ }
}

If your module's own AbpModule sets SkipAutoServiceRegistration = true, ITransientDependency alone won't register this class — register it explicitly (a reflection scan over IExportDataProvider implementers, same pattern as any other conventionally-disabled class in that module, works well and means adding a new provider is still zero registration code).

Add a thin concrete subclass in your service so ABP's conventional controller discovery (which only scans your own assembly) picks it up. The [Route] attribute below is required, not optional — ExportAsync/GetExportStatusAsync/DownloadAsync use explicit [HttpPost("run")]/[HttpGet("...")] templates (to keep exact control over the URLs), and ABP's conventional route builder only auto-prepends api/{module}/{controller} for actions that rely purely on naming convention — for explicitly-attributed actions, ASP.NET Core uses the template literally unless the controller supplies a [Route] prefix to combine with it. Skip this and abp generate-proxy (and the real running routes) will bind bare paths like /run instead of /api/{module}/export/run:

[RemoteService]
[Route("api/{yourModuleNameLowercase}/export")] // e.g. "api/airwaybillmanagement/export"
public class ExportAppService : ExportAppServiceBase
{
    public ExportAppService(GenericExportExecutor executor, IBackgroundJobManager backgroundJobManager, IOptions<AbpExportingOptions> options)
        : base(executor, backgroundJobManager, options) { }
}

Angular

const { isBackground, downloadToken } = await exportService.exportAsync({ moduleKey: 'Country', filterGroups, sortField, sortOrder });
if (isBackground) {
  // poll exportService.getExportStatusAsync(downloadToken) until Ready
}
const file = await exportService.downloadAsync(downloadToken);

One method, no per-module Angular service, no switch/case.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
1.0.2 104 9/3/2026
1.0.1 103 8/21/2026
1.0.0 117 8/14/2026