GM.API 1.4.0

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

<p align="center"> <img src="https://raw.githubusercontent.com/gmetskhvarishvili/GM.API/master/icon.png" alt="GM.API" width="140" height="140" /> </p>

GM.API

CI NuGet License: MIT

An opinionated ASP.NET Core Web API starter for .NET. A single AddGMAPI / UseGMAPI pair wires up controllers, CORS, API versioning, Swagger docs, FluentValidation, Serilog, and a set of middlewares (exception handling, request logging with sensitive-data masking, and request localization). Part of the GM.* family of packages. Targets net10.0.

Packages

This repository ships six packages that version and release in lockstep:

Package What it provides
GM.API The umbrella package — AddGMAPI/UseGMAPI, base controllers, Serilog host builder.
GM.API.Application GM.Mediator wiring + validation & performance pipeline behaviours, paged-list models.
GM.API.Cors One-call CORS policy (AddGMCors/UseGMCors).
GM.API.Middlewares Exception handling, request logging (with masking), localization middlewares.
GM.API.Shared Shared primitives built on GM.Mapper.
GM.API.Versioning URL-segment API versioning + API explorer.

Install

dotnet add package GM.API

GM.API pulls in the companion packages; add the smaller ones directly if you only need a slice (e.g. just GM.API.Middlewares).

Use

using GM.API.Startup;

var builder = ProgramExtension.CreateGMBuilder(args);   // WebApplicationBuilder + Serilog + config

builder.Services.ConfigureGMServices(
    builder.Configuration,
    policyName: "DefaultCors",
    swaggerOptionsName: "SwaggerDocOptions");

var app = builder.Build();

app.UseGMServices();   // docs, routing, CORS, logging, localization, exception handling, controllers

app.Run();

What you get

  • Thin controllersBaseController exposes a lazily-resolved IMediator and pagination helpers.
  • Validation — FluentValidation auto-validation plus a mediator RequestValidationBehavior.
  • CORS, versioning, Swagger — wired from configuration in one call each.
  • Middlewares — RFC-7807 exception handling, request/response logging with sensitive-field masking, and Accept-Language-driven request localization.
  • Serilog — host configured from appsettings.json, with environment/process/thread enrichers.

Requirements

Contributing & releases

Versioning is automated from Conventional Commits — see CONTRIBUTING.md. All six packages release together under one version.

License

MIT — see LICENSE.

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.4.0 115 7/31/2026
1.3.0 110 7/2/2026
1.2.0 134 3/1/2026
1.0.0 283 7/26/2025