OptimusFramework.Api 2.0.1

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

OptimusFramework.Api

ASP.NET Core API layer for the Optimus Framework. Provides base controllers with automatic CRUD routing, global exception handling, tenant middleware, and request/response filters.

Features

  • Auto-CRUD Controller: AppApiCrudController exposes 9+ routes automatically (list, getbykey, store, enable, disable, delete, and bulk variants)
  • Base Controllers: AppApiController, AppApiListableController, AppApiStoreController for different API patterns
  • Global Exception Handling: GlobalExceptionFilter and GlobalExceptionMiddleware converting exceptions to ApiResponse<string>
  • Multi-Tenant Middleware: TenantMiddleware and TenantInfoProvider for tenant resolution per request
  • Validation Filter: Automatic request DTO validation
  • API Utilities: ApiUtils for header extraction, token decoding, claim identity parsing

Key Classes

Class Description
AppApiController Base controller with OkApiResponse helpers
AppApiCrudController Full CRUD: POST /list, GET /getbykey/{id}, POST /store, PUT /enable/{id}, PUT /disable/{id}, DELETE /delete/{id}, and bulk operations
AppApiListableController List-only controller
AppApiStoreController Store-only controller
GlobalExceptionFilter IExceptionFilter for standardized error responses
GlobalExceptionMiddleware Middleware for pipeline-level exception handling
TenantMiddleware Tenant context resolution middleware
ApiUtils Static helpers for auth headers, claims, and tokens

Installation

dotnet add package OptimusFramework.Api

Usage

using OptimusFramework.Api.Controllers;

[ApiController]
[Route("api/products")]
public class ProductController : AppApiCrudController<IProductService, ProductFilter, ProductParam, ProductDto, int>
{
    public ProductController(IProductService service) : base(service) { }
    // Automatically exposes:
    // POST   /api/products/list
    // POST   /api/products/list_count
    // GET    /api/products/getbykey/{id}
    // POST   /api/products/store
    // PUT    /api/products/enable/{id}
    // PUT    /api/products/disable/{id}
    // DELETE /api/products/delete/{id}
}
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 (3)

Showing the top 3 NuGet packages that depend on OptimusFramework.Api:

Package Downloads
OptimusLog.Api

Package Description

SfeAuth.Core.Generic.Api

Package Description

SfeAuth.Core.Domain

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 140 2/18/2026
2.0.0 118 2/18/2026