AugusteVN.Modules.Sponsorships.Api 1.0.7

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

AugusteVN.Modules.Sponsorships.Api

Minimal API endpoints for sponsor segment management — with scoped-permission authorization, FluentValidation, and CQRS dispatch via Mapster.

Part of the AugusteVN Modules collection.

Extension Methods

AddSponsorshipsApi(this IServiceCollection, IConfiguration)

Registers the Sponsorships API layer:

  • Scans the _Shared assembly for FluentValidation validators (CreateSponsorSegmentRequest and related) and registers them in the DI container.

MapSponsorshipsEndpoints(this IEndpointRouteBuilder)

Maps all sponsor segment endpoints under a single route group (SponsorSegments) with:

  • Tagged Swagger grouping (SponsorSegments)
  • ApiExceptionFilter for centralized exception-to-ProblemDetails mapping
  • Individual endpoint registration via extension methods

API Routes

All routes are grouped under /SponsorSegments.

Method Route Authorization Description
GET /SponsorSegments/ ManageSponsorships Retrieve a paginated list of all sponsor segments
GET /SponsorSegments/{Id} ManageSponsorships Retrieve a single sponsor segment by ID
GET /SponsorSegments/Content Anonymous Retrieve the sponsor segment for a specific blog post
POST /SponsorSegments/ Anonymous Create a new sponsor segment (validated)
PUT /SponsorSegments/ ManageSponsorships Update an existing sponsor segment (validated)

GET /SponsorSegments/

Retrieves paginated sponsor segments. Accepts PageNumber and PageSize query parameters via GetSponsorSegmentsRequest. Requires ManageSponsorships permission.

GET /SponsorSegments/{Id}

Retrieves a single sponsor segment by its unique Guid identifier. Requires ManageSponsorships permission.

GET /SponsorSegments/Content

Retrieves the sponsor segment associated with a specific blog post via BlogPostSlug query parameter. This endpoint is publicly accessible (no authorization) so content pages can embed sponsor segments.

POST /SponsorSegments/

Creates a new sponsor segment. The request body is validated through EndpointValidationFilter<CreateSponsorSegmentRequest>. Returns 204 No Content on success.

PUT /SponsorSegments/

Updates an existing sponsor segment. Requires ManageSponsorships permission. The request body is validated through EndpointValidationFilter<UpdateSponsorSegmentRequest>. Returns 204 No Content on success.

Authorization

Endpoints use the RequirePermission extension method on the route builder chain:

builder.MapGet("/", GetSponsorSegmentsAsync)
    .RequirePermission(nameof(Sponsorships), (int)Permissions.ManageSponsorships);

The GetSponsorSegmentsForContent endpoint is intentionally left without authorization to allow anonymous content rendering.

Error Handling

All endpoints use ApiExceptionFilter (extending EndpointExceptionFilter) to convert exceptions into RFC 7807 Problem Details responses. CQRS results use the Result pattern — failures are mapped to Results.Problem(result.Error.Description).

Registration

// Program.cs
builder.Services.AddSponsorshipsApi(builder.Configuration);

app.MapSponsorshipsEndpoints();

Installation

dotnet add package AugusteVN.Modules.Sponsorships.Api

Full Documentation

See the Sponsorships Module README for complete documentation.

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.7 98 8/9/2026
1.0.6 88 8/9/2026
1.0.2 95 8/8/2026
1.0.1 83 8/8/2026
1.0.0 96 8/8/2026