{"id":19099737,"url":"https://github.com/michelcedric/StructuredMinimalApi","last_synced_at":"2025-04-18T17:31:53.246Z","repository":{"id":37893639,"uuid":"442822628","full_name":"michelcedric/StructuredMinimalApi","owner":"michelcedric","description":"The goal of this project it's to show how to use MinimalApi.Endpoint package. It demontrate how to configure API endpoints as individual classes based on minimal Api (.Net 6)","archived":false,"fork":false,"pushed_at":"2023-03-21T22:01:06.000Z","size":58,"stargazers_count":85,"open_issues_count":6,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-31T11:15:19.757Z","etag":null,"topics":["api","csharp","dotnet","minimal-api","minimalapi"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michelcedric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-29T16:02:51.000Z","updated_at":"2024-06-03T21:36:13.000Z","dependencies_parsed_at":"2023-02-12T08:45:57.194Z","dependency_job_id":null,"html_url":"https://github.com/michelcedric/StructuredMinimalApi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelcedric%2FStructuredMinimalApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelcedric%2FStructuredMinimalApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelcedric%2FStructuredMinimalApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelcedric%2FStructuredMinimalApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michelcedric","download_url":"https://codeload.github.com/michelcedric/StructuredMinimalApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783108,"owners_count":17201903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","csharp","dotnet","minimal-api","minimalapi"],"created_at":"2024-11-09T03:52:14.342Z","updated_at":"2024-11-09T03:52:16.853Z","avatar_url":"https://github.com/michelcedric.png","language":"C#","funding_links":[],"categories":["api","dotnet"],"sub_categories":[],"readme":"[![Build status](https://github.com/michelcedric/StructuredMinimalApi/actions/workflows/dotnet.yml/badge.svg)](https://github.com/michelcedric/StructuredMinimalApi/actions/workflows/dotnet.yml)\n[![Downloads](https://img.shields.io/nuget/dt/MinimalApi.Endpoint?color=blue\u0026label=Downloads\u0026logo=nuget)](https://www.nuget.org/packages/MinimalApi.Endpoint)\n# StructuredMinimalApi\nThe goal of this project it's to show how to use MinimalApi.Endpoint package.  \nIt demontrate how to configure API endpoints as individual classes based on minimal Api (.Net 6)\n\n## Program.cs\nUse [AddEndpoints](https://github.com/michelcedric/StructuredMinimalApi/blob/master/MinimalApi.Endpoint/Extensions/IServiceCollectionExtensions.cs#L7) extenion method to create each endpoint.\n\nAnd also [MapEndpoint](https://github.com/michelcedric/StructuredMinimalApi/blob/master/MinimalApi.Endpoint/Extensions/IEndpointRouteBuilderExtensions.cs#L8) extension method to use new routing APIs\n\n```csharp\nvar builder = WebApplication.CreateBuilder(args);\n\nbuilder.Services.AddEndpoints();\n\nvar app = builder.Build();\n\napp.MapEndpoints();\n\napp.Run();\n```\n\n## Define an endpoint\nTo create and define one endpoint, it needs to implement [IEndpoint](https://github.com/michelcedric/StructuredMinimalApi/blob/master/MinimalApi.Endpoint/IEndpoint.cs) interface\n\n```csharp\npublic class GetWithParamEndpoint : IEndpoint\u003cstring, string\u003e\n    {\n        public void AddRoute(IEndpointRouteBuilder app)\n        {\n            app.MapGet(\"/Todo/2/{param1}\", (string param1) =\u003e HandleAsync(param1));\n        }\n\n        public Task\u003cstring\u003e HandleAsync(string request)\n        {\n            return Task.FromResult($\"Hello World! 2 {request}\");\n        }\n    }\n```\n\n## Projects Using MinimalApi.Endpoint\n\n- [eShopOnWeb](https://github.com/dotnet-architecture/eShopOnWeb): Sample ASP.NET Core reference application, powered by Microsoft\n    - [Use in PublicApi project](https://github.com/dotnet-architecture/eShopOnWeb/tree/main/src/PublicApi): This project demonstrates how to configure endpoints as individual classes    \n\n- [EshopOnVue.js](https://github.com/michelcedric/EshopOnVue.js): Same as EshopOnWeb project in Vue.js\n\n- [StructuredMinimalApi](https://github.com/michelcedric/StructuredMinimalApi/tree/master/StructuredMinimalApi): Sample project to show some usage\n\n- [WebApiBestPractices](https://github.com/ardalis/WebApiBestPractices): Resources related to Ardalis Pluralsight course on this topic.\n    - [Pluralsight : ASP.NET Core 6 Web API: Best Practices](https://www.pluralsight.com/courses/aspdotnet-core-6-web-api-best-practices): Organizing Minimal API demo and best practices.\n\n## Nuget Package\nA nuget package is available [here](https://www.nuget.org/packages/MinimalApi.Endpoint/). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelcedric%2FStructuredMinimalApi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichelcedric%2FStructuredMinimalApi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelcedric%2FStructuredMinimalApi/lists"}