{"id":49028113,"url":"https://github.com/keizrivas/aspnetconventions","last_synced_at":"2026-05-04T03:02:01.972Z","repository":{"id":333732044,"uuid":"1113579844","full_name":"keizrivas/AspNetConventions","owner":"keizrivas","description":"Automatically standardizes routes, parameters, responses, JSON serialization, and exception handling with zero boilerplate. Drop-in support for MVC Controllers, Minimal APIs, and Razor Pages.","archived":false,"fork":false,"pushed_at":"2026-04-27T06:10:23.000Z","size":3495,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T06:27:47.179Z","etag":null,"topics":["api-conventions","aspnetcore","conventions","csharp","dotnet","json-serialization","minimal-api","mvc","razor-pages","rest-api","routing","web-api"],"latest_commit_sha":null,"homepage":"https://keizrivas.github.io/AspNetConventions/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keizrivas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-10T07:07:52.000Z","updated_at":"2026-04-27T06:10:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e48cb277-a194-44d7-bf75-a6beb76318bc","html_url":"https://github.com/keizrivas/AspNetConventions","commit_stats":null,"previous_names":["keizrivas/aspnetconventions"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/keizrivas/AspNetConventions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keizrivas%2FAspNetConventions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keizrivas%2FAspNetConventions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keizrivas%2FAspNetConventions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keizrivas%2FAspNetConventions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keizrivas","download_url":"https://codeload.github.com/keizrivas/AspNetConventions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keizrivas%2FAspNetConventions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32592720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-conventions","aspnetcore","conventions","csharp","dotnet","json-serialization","minimal-api","mvc","razor-pages","rest-api","routing","web-api"],"created_at":"2026-04-19T08:00:44.834Z","updated_at":"2026-05-04T03:02:01.962Z","avatar_url":"https://github.com/keizrivas.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AspNetConventions\n\n[![License](https://img.shields.io/github/license/keizrivas/AspNetConventions?label=License\u0026labelColor=383f47)](https://github.com/keizrivas/AspNetConventions?tab=MIT-1-ov-file)\n[![Build Status](https://github.com/keizrivas/AspNetConventions/actions/workflows/build.yml/badge.svg)](https://github.com/keizrivas/AspNetConventions/actions/workflows/build.yml)\n[![NuGet Version](https://img.shields.io/nuget/v/AspNetConventions.svg?color=00a6f4\u0026logo=nuget\u0026logoColor=959da5\u0026label=NuGet\u0026labelColor=383f47)](https://www.nuget.org/packages/AspNetConventions)\n[![Documentation](https://img.shields.io/badge/Docs-AspNetConventions-155dfc?logo=gitbook\u0026logoColor=959da5\u0026labelColor=383f47)](https://keizrivas.github.io/AspNetConventions/)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/AspNetConventions.svg?color=9e5dec\u0026label=Downloads\u0026labelColor=383f47)](https://www.nuget.org/packages/AspNetConventions)\n[![.NET](https://img.shields.io/badge/.NET-8.0+-512BD4.svg?labelColor=383f47)](https://dotnet.microsoft.com/download)\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/keizrivas/AspNetConventions/main/assets/asp_net_conventions.svg\" width=\"250\"\u003e\n    \u003cimg alt=\"AspNetConventions\" src=\"https://raw.githubusercontent.com/keizrivas/AspNetConventions/main/assets/asp_net_conventions_light.svg\" width=\"250\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n**Convention-driven standardization for ASP.NET Core** - Automatically applies consistent standardization across ASP.NET Core applications — including APIs, MVC, and Razor Pages — with minimal configuration and zero boilerplate.\n\n\u003cp align=\"center\"\u003e\n    \u003cpicture\u003e\n        \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/keizrivas/AspNetConventions/main/assets/banner.png\" width=\"100%\"\u003e\n        \u003cimg alt=\"AspNetConventions\" src=\"https://raw.githubusercontent.com/keizrivas/AspNetConventions/main/assets/banner_light.png\" width=\"100%\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n## Why AspNetConventions?\n\nWe believe API building should be intuitive. **AspNetConventions** transforms standard ASP.NET setups into a modern API solution by applying smart global behaviors automatically:\n\n- **Universal Endpoint Support** - Consistent URL structure across MVC, Minimal APIs, and Razor Pages.\n- **Automatic Route standardization** - Route and parameter names are transformed and bound automatically follow your preferred casing style.\n- **Standardized responses** - Uniform JSON formatting and consistent response formatting application-wide.\n- **Global exception handling** - Centralized error handling and formatting throughout your codebase.\n- **Fully Extensible** - Supports custom converters, mappers, hooks, and response formatters, as well as third-party library compatibility.\n- **Zero Runtime Overhead** - Conventions are applied during application startup, no performance impact on requests.\n\n## Quick Start\n\n### Installation\n\n```bash\ndotnet add package AspNetConventions\n```\n\n### Basic Configuration\n\n```csharp\n// Program.cs\nusing AspNetConventions;\n\nvar builder = WebApplication.CreateBuilder(args);\n\n// Apply conventions to MVC Controllers/Razor Pages\nbuilder.Services\n  .AddControllersWithViews()\n  .AddAspNetConventions();\n\nvar app = builder.Build();\n\n// Apply conventions to Minimal APIs\nvar api = app.UseAspNetConventions();\n\napi.MapGet(\"/GetUser/{UserId}\", (int UserId) =\u003e new { userId = UserId });\n\napp.Run();\n```\n\n**That's it!** Your entire application now follows consistent conventions.\n\n## Documentation\n\nVisit the full documentation at: **[keizrivas.github.io/AspNetConventions](https://keizrivas.github.io/AspNetConventions/)**\n\n## Route standardization Examples\n\n### MVC Controllers\n\n**Your Code:**\n```csharp\n[ApiController]\n[Route(\"Api/[controller]\")]\npublic class UsersController : ControllerBase\n{\n    [HttpGet(\"[Action]/{id}\")]\n    public ActionResult PublicProfile(int id) \n    {\n        return Ok(new { UserId = id, Name = \"John Doe\" });\n    }\n}\n```\n\n**Standardized Route:**\n```\nGET /api/users/public-profile/{id}\n```\n\n---\n\n### Minimal APIs\n\n**Your Code:**\n```csharp\n\nvar api = app.UseAspNetConventions();\n\napi.MapGet(\"/WeatherForecasts/City/{name}\", (string name) =\u003e \n    Results.Ok(new { CityName = name, Temperature = 72 }));\n\n```\n\n**Standardized Route:**\n```\nGET /api/weather-forecasts/city/{name}\n```\n\n---\n\n### Razor Pages\n\n**Your Code:**\n```csharp\n// Pages/UserProfile/Edit.cshtml.cs\npublic class EditModel : PageModel\n{\n    public void OnGet(int UserId) \n    {\n        // Your logic here\n    }\n}\n```\n\n```razor\n// Pages/UserProfile/Edit.cshtml\n@page \"{UserId:int}\"\n@model EditModel\n\n\u003ch2\u003eEdit User\u003c/h2\u003e\n```\n\n**Standardized Route:**\n```\nGET /user-profile/edit/{user-id}\n```\n\n## Response standardization Examples\n\n### Success Response\n\n```json\n{\n  \"status\": \"success\",\n  \"statusCode\": 200,\n  \"message\": \"User created successfully.\",\n  \"data\": {\n    \"userId\": 1,\n    \"name\": \"John Doe\",\n    \"email\": \"john.doe@email.com\"\n  },\n  \"metadata\": {\n    \"requestType\": \"PUT\",\n    \"timestamp\": \"0000-00-00T00:00:00.000000Z\",\n    \"traceId\": \"00-ed89d1cc507c35126d6f0e933984f774-99b8b9a3feb75652-00\",\n    \"path\": \"/api/users/{id}\"\n  }\n}\n```\n\n### Validation Error Response\n\n```json\n{\n  \"status\": \"failure\",\n  \"statusCode\": 400,\n  \"type\": \"VALIDATION_ERROR\",\n  \"message\": \"One or more validation errors occurred.\",\n  \"errors\": [\n    {\n      \"Email\": [\n        \"'Email' is not a valid email address.\"\n      ]\n    }\n  ],\n  \"metadata\": {\n    \"requestType\": \"PUT\",\n    \"timestamp\": \"0000-00-00T00:00:00.000000Z\",\n    \"traceId\": \"00-8e5513ae9369648487c2323d9a3508aa-2a8f92c7d45d3f74-00\",\n    \"path\": \"/api/users/{id}\"\n  }\n}\n```\n\n## Contributing\n\n[Contributions](https://github.com/keizrivas/AspNetConventions/tree/main?tab=contributing-ov-file), [issues](https://github.com/keizrivas/AspNetConventions/issues), and [feature requests](https://github.com/keizrivas/AspNetConventions/pulls) are welcome!\n\nIf you believe a convention should be improved or added, feel free to open a [discussion](https://github.com/keizrivas/AspNetConventions/discussions).\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](https://github.com/keizrivas/AspNetConventions/tree/main?tab=MIT-1-ov-file) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeizrivas%2Faspnetconventions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeizrivas%2Faspnetconventions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeizrivas%2Faspnetconventions/lists"}