AspNetConventios 1.0.2

Suggested Alternatives

AspNetConventions

Additional Details

Deprecated

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package AspNetConventios --version 1.0.2
                    
NuGet\Install-Package AspNetConventios -Version 1.0.2
                    
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="AspNetConventios" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AspNetConventios" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="AspNetConventios" />
                    
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 AspNetConventios --version 1.0.2
                    
#r "nuget: AspNetConventios, 1.0.2"
                    
#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 AspNetConventios@1.0.2
                    
#: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=AspNetConventios&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=AspNetConventios&version=1.0.2
                    
Install as a Cake Tool

AspNetConventions

NuGet Version NuGet Downloads Build Status License DotNet

<br /> <div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./assets/asp_net_conventions_dark.svg" width="250"> <img alt="AspNetConventions" src="./assets/asp_net_conventions.svg" width="250"> </picture> </div> <br />

Automatic naming conventions for ASP.NET Core - Transform your routes, parameters, and responses to kebab-case, snake_case, camelCase, or PascalCase with zero boilerplate.

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./assets/banner_dark.png" width="100%"> <img alt="AspNetConventions" src="./assets/banner.png" width="100%"> </picture> </div>

Features

  • Automatic Route Transformation - /GetUserById → /get-user-by-id
  • Parameter Binding - {UserId} → {user-id} with automatic binding
  • Response Formatting - Standardized JSON responses
  • Multiple Endpoint/Routes Types - MVC Controllers, Minimal APIs, Razor Pages
  • Flexible Casing - kebab-case, snake_case, camelCase, PascalCase
  • Zero Overhead - Conventions applied at startup

Quick Start

Installation

dotnet add package AspNetConventions

Basic Usage

// ./Program.cs

var builder = WebApplication.CreateBuilder(args);

// Add conventions to MVC/Razor Pages (IMvcBuilder)
builder.Services.AddControllersWithViews()
    .AddAspNetConventions();

var app = builder.Build();

app.MapGet("/GetUser/{UserId}", (int UserId) => new { userId = UserId });

// Apply conventions to Minimal APIs (WebApplication)
app.UseAspNetConventions();

app.Run();

Examples

MVC Controllers

[ApiController]
[Route("api/[controller]")]
public class UserProfileController : ControllerBase
{
    [HttpGet("GetById/{UserId}")]
    public IActionResult GetById(int UserId) => Ok();
}

//Result: GET /api/user-profile/get-by-id/{user-id}

Minimal APIs

app.MapGet("/WeatherForecast/{CityName}", (string CityName) => 
    Results.Ok(new { city = CityName }));
    
// Result: GET /weather-forecast/{city-name}

Razor Pages

// ./Pages/UserProfile/Edit.cshtml.cs
public class EditModel : PageModel
{
    public void OnGet(int UserId) { }
}

// Result: /user-profile/edit/{user-id}

License

This project is licensed under the MIT License - see LICENSE file for details.

Acknowledgments

  • Built on ASP.NET Core's extensibility
  • Thanks to all contributors

Support


Made with ❤️ for the ASP.NET Core community

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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