GM.API.Application
1.4.0
dotnet add package GM.API.Application --version 1.4.0
NuGet\Install-Package GM.API.Application -Version 1.4.0
<PackageReference Include="GM.API.Application" Version="1.4.0" />
<PackageVersion Include="GM.API.Application" Version="1.4.0" />
<PackageReference Include="GM.API.Application" />
paket add GM.API.Application --version 1.4.0
#r "nuget: GM.API.Application, 1.4.0"
#:package GM.API.Application@1.4.0
#addin nuget:?package=GM.API.Application&version=1.4.0
#tool nuget:?package=GM.API.Application&version=1.4.0
<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
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 controllers —
BaseControllerexposes a lazily-resolvedIMediatorand 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 | Versions 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. |
-
net10.0
- GM.API.Shared (>= 1.4.0)
- GM.Exceptions (>= 1.2.1)
- GM.Mediator (>= 1.3.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on GM.API.Application:
| Package | Downloads |
|---|---|
|
GM.API
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 middlewares for exception handling, request logging (with sensitive-data masking) and request localization. Bundles the GM.API.* companion packages. |
GitHub repositories
This package is not used by any popular GitHub repositories.