An open-source project (MIT license) that targets and complements the Carter API library. It provides a uniform and convenient way of doing API development for all project types in .NET.
Your versatile Carter companion for modern development with .NET 9 and .NET 10.
It is, by heart, free, flexible and built to extend and boost your agile codebelt.
The Extensions for Carter API by Codebelt is designed to bring clarity, structure, and consistency to Carter projects. It provides a focused extension layer for Carter with configurable response negotiation primitives and endpoint metadata helpers for ASP.NET Core minimal APIs.
These are the standalone response negotiator packages that extend the core Codebelt.Extensions.Carter package with specific content negotiation capabilities:
using Carter;
using Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Formatters;
using Codebelt.Extensions.Carter.AspNetCore.Newtonsoft.Json;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddNewtonsoftJsonFormatterOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator<NewtonsoftJsonNegotiator>());
var app = builder.Build();
app.MapCarter();
app.Run();using Carter;
using Codebelt.Extensions.Carter.AspNetCore.Text.Json;
using Cuemon.Extensions.AspNetCore.Text.Json;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalJsonOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator<JsonResponseNegotiator>());
var app = builder.Build();
app.MapCarter();
app.Run();using Carter;
using Codebelt.Extensions.AspNetCore.Text.Yaml.Formatters;
using Codebelt.Extensions.Carter.AspNetCore.Text.Yaml;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalYamlOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator<YamlResponseNegotiator>());
var app = builder.Build();
app.MapCarter();
app.Run();using Carter;
using Codebelt.Extensions.Carter.AspNetCore.Xml;
using Cuemon.Extensions.AspNetCore.Xml;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalXmlOptions();
builder.Services.AddCarter(c => c
.WithResponseNegotiator<XmlResponseNegotiator>());
var app = builder.Build();
app.MapCarter();
app.Run();Full documentation (generated by DocFx) located here: https://carter.codebelt.net/
Provides a focused API for BenchmarkDotNet projects.
Contributions are welcome and appreciated.
Feel free to submit issues, feature requests, or pull requests to help improve this library.
This project is licensed under the MIT License - see the LICENSE file for details.