{"id":18732419,"url":"https://github.com/deshansl/slices-endpoints-nuget","last_synced_at":"2026-01-23T13:48:34.865Z","repository":{"id":258988712,"uuid":"876047759","full_name":"DeshanSL/slices-endpoints-nuget","owner":"DeshanSL","description":"This NuGet package simplifies the implementation of minimal APIs within nested, non-static classes, making it an ideal choice for organizing endpoints in vertical slice architecture projects. It provides a clean, modular structure that enhances code organization by grouping related endpoints within feature-based classes.","archived":false,"fork":false,"pushed_at":"2024-10-30T06:32:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T16:07:07.193Z","etag":null,"topics":["dotnet","dotnetco","endpoint","minimal-api","minimalapi","nested","software-architecture","support","vertical","vertical-slice-architecture"],"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/DeshanSL.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,"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":"2024-10-21T10:06:55.000Z","updated_at":"2024-10-30T06:32:26.000Z","dependencies_parsed_at":"2025-09-01T01:31:10.542Z","dependency_job_id":"cf04e6b4-70b6-40c0-890b-9e0799467b95","html_url":"https://github.com/DeshanSL/slices-endpoints-nuget","commit_stats":null,"previous_names":["deshansl/slices-endpoints-nuget"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DeshanSL/slices-endpoints-nuget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeshanSL%2Fslices-endpoints-nuget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeshanSL%2Fslices-endpoints-nuget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeshanSL%2Fslices-endpoints-nuget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeshanSL%2Fslices-endpoints-nuget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeshanSL","download_url":"https://codeload.github.com/DeshanSL/slices-endpoints-nuget/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeshanSL%2Fslices-endpoints-nuget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dotnet","dotnetco","endpoint","minimal-api","minimalapi","nested","software-architecture","support","vertical","vertical-slice-architecture"],"created_at":"2024-11-07T15:06:03.127Z","updated_at":"2026-01-23T13:48:34.817Z","avatar_url":"https://github.com/DeshanSL.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slices-endpoints-nuget\nThis NuGet package simplifies the implementation of minimal APIs within nested, non-static classes, making it an ideal choice for organizing endpoints in vertical slice architecture projects. It provides a clean, modular structure that enhances code organization by grouping related endpoints within feature-based classes.\n\n## Start services\n\n```bash\ndotnet add package Slices.Endpoints.Mapper --version 1.0.0\n```\n\nCurrent working assembly must be provided by referencing one of your classes\n```csharp\napp.UseSliceEndpoints(options =\u003e\n{\n      options.RegisterEndpointsFromAssembly(typeof(Program).Assembly);\n});\n```\n\n# Implementations\n\n## Using IHasEndpoints interface\n\nBeing nested or implementing IFeature interface is not mandatory when using IHasEndpoints\n\n```csharp\npublic class CreateOrder : IFeature\n{\n    public record Command() : IRequest\u003cReturn\u003cOrderId\u003e\u003e\n    {\n    };\n\n    internal sealed class Handler : IRequestHandler\u003cCommand, Return\u003cOrderId\u003e\u003e\n    {\n        private readonly IAppEventStore _store;\n\n        public Handler(IAppEventStore store)\n        {\n            _store = store;\n        }\n        public async Task\u003cReturn\u003cOrderId\u003e\u003e Handle(Command request, CancellationToken cancellationToken)\n        {\n           // Handler logic\n        }\n    }\n    // THIS ENDPOINT WILL BE MAPPED TO THE ROUTER BY THE PACKAGE\n    public class Endpoint : IHasEndpoints\n    {\n        public record Request()\n        {\n        }\n        public void Map(IEndpointRouteBuilder app)\n        {\n            app.MapPost(\"api/orders\", async ([FromBody] Request request, [FromServices] IMediator mediator) =\u003e\n            {\n                var result = await mediator.Send(new Command());\n                return result.Value;\n            });\n        }\n    }\n\n}\n```\n\n## Using naming convention\n\n MANDATORY to implement IFeature marker interface for declaring class/type of \"Endpoints\"\n\n```csharp\n// Implementing IFeature is MUST to use naming convention.\npublic class CreateOrder : IFeature\n{\n    // Nested class should be named Endpoints\n    public class Endpoints\n    {\n        public record Request()\n        {\n        }\n        // Map method SHOULD accept IEndpointRouteBuilder\n        public void Map(IEndpointRouteBuilder app)\n        {\n            app.MapPost(\"api/orders\", async ([FromBody] Request request, [FromServices] IMediator mediator) =\u003e\n            {\n                var result = await mediator.Send(new Command());\n                return result.Value;\n            });\n        }\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeshansl%2Fslices-endpoints-nuget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeshansl%2Fslices-endpoints-nuget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeshansl%2Fslices-endpoints-nuget/lists"}