{"id":22316510,"url":"https://github.com/jomaxso/segres","last_synced_at":"2026-05-02T13:34:51.584Z","repository":{"id":42368083,"uuid":"473235889","full_name":"jomaxso/Segres","owner":"jomaxso","description":"A mediator library for .Net using strongly-typed handler implementations. It provides a synchronise and asynchronise api, which is optimized for speed and memory.","archived":false,"fork":false,"pushed_at":"2023-01-27T20:26:00.000Z","size":463,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-24T19:40:01.445Z","etag":null,"topics":["asp-net-core","aspnet-web-api","aspnetcore","dotnet","dotnet-core","dotnet7","mediation","minimal-api","net7","pubsub","sender-reciever"],"latest_commit_sha":null,"homepage":"","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/jomaxso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-23T14:57:13.000Z","updated_at":"2023-01-15T19:39:05.000Z","dependencies_parsed_at":"2023-02-15T12:31:29.175Z","dependency_job_id":null,"html_url":"https://github.com/jomaxso/Segres","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jomaxso/Segres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomaxso%2FSegres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomaxso%2FSegres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomaxso%2FSegres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomaxso%2FSegres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jomaxso","download_url":"https://codeload.github.com/jomaxso/Segres/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomaxso%2FSegres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32481591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["asp-net-core","aspnet-web-api","aspnetcore","dotnet","dotnet-core","dotnet7","mediation","minimal-api","net7","pubsub","sender-reciever"],"created_at":"2024-12-03T23:06:52.056Z","updated_at":"2026-05-02T13:34:51.565Z","avatar_url":"https://github.com/jomaxso.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jomaxso/Segres/\"\u003e\n    \u003cimg src=\"#\" alt=\"Segres\" width=\"125\"\u003e\n  \u003c/a\u003e\n\n\u003ch2 align=\"center\"\u003eSEGRES\u003c/h2\u003e\n\n  \u003cp align=\"center\"\u003e\n    The simple way to segerate your responsibilities.\n\u003cbr /\u003e\n\u003cbr /\u003e\n    \u003ca href=\"#\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"#\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/jomaxso/Segres/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/jomaxso/Segres/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\n[![NuGet version](https://badgen.net/nuget/v/Segres)](https://www.nuget.org/packages/Segres/)\n[![NuGet downloads](https://badgen.net/nuget/dt/Segres)](https://www.nuget.org/packages/Segres/)\n[![Test status](https://badgen.net/github/checks/jomaxso/Segres/master/test)](https://www.nuget.org/packages/Segres/)\n\n\n\n\n\u003c/div\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\nA mediator library for .Net using strongly-typed handler implementations. It provides a synchronise and asynchronise api, which is optimized for speed and memory.\n\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting Started\n\nSegres can be installed using the Nuget package manager or the dotnet CLI.\n\n```shell\ndotnet add package Segres \n```\n\n\u003ca href=\"#\"\u003eExplore the documentation\u003c/a\u003e for instructions on how to use the package.\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n## Example\n\n### Segres\n#### Register all dependencies\n\n```csharp\n// Program.cs\n\nusing Segres\n\n...\n\nbuilder.Services.AddSegres(); \n\n...\n\n```\n\n### Segres.Abstractions\n#### Create a handler\n\n```csharp\n// CreateCustomerRequestHandler.cs\n\nusing Segres;\n\npublic record CreateCustomerRequest(string Firstname, string Lastname) : IRequest\u003cGuid\u003e;\n\npublic sealed class CreateCustomerRequestHandler : IRequestHandler\u003cCreateCustomerRequest, Guid\u003e\n{\n    public async ValueTask\u003cGuid\u003e HandleAsync(CreateCustomerRequest request, CancellationToken cancellationToken)\n    {\n        await ValueTask.CompletedTask;\n        return Guid.NewGuid();\n    }\n} \n```\n\n#### Send a request\n\n```csharp\n// SomeService.cs\n\nusing Segres;\n\npublic class SomeService\n{\n    private readonly IMediator _mediator;\n\n    public SomeService(IMediator mediator)\n    {\n        _mediator = mediator;\n    }\n    \n    ...\n    \n    public async ValueTask\u003cGuid\u003e SomeMethodAsync(CancellationToken cancellationToken)\n    {\n        var request = new CreateCustomerRequest(\"Peter\", \"Parker\");\n        Guid id = await _mediator.SendAsync(request, cancellationToken);\n        return id;\n    }\n}\n\n```\n\n### Segres.AspNetCore\n\n#### Register all endpoints\n\n```csharp\n// Program.cs\n\nusing Segres\n\n...\n\napp.UseSegres(); \n\n...\n\n```\n\n#### Create a request\n\n```csharp\n// CreateUserRequest.cs\n\npublic record CreateUserRequest() : IHttpRequest\u003cint\u003e\n{\n    public static string EndpointRoute =\u003e \"/create\";\n    public static RequestType RequestType =\u003e RequestType.Post;\n}\n```\n\n#### Create an endpoint for a request\n\n```csharp\n// CreateUserEndpoint.cs\n\npublic sealed class CreateUserEndpoint : AbstractEndpoint\u003cCreateUserRequest, int\u003e\n{\n    public override async ValueTask\u003cHttpResult\u003cint\u003e\u003e ResolveAsync(CreateUserRequest request, CancellationToken cancellationToken)\n    {\n        int result = await ...\n        return Ok(result)\n    }\n}\n```\n_For more examples, please refer to the [Documentation](#)_\n\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\nDistributed under the MIT License. See `LICENSE.md` for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomaxso%2Fsegres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjomaxso%2Fsegres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomaxso%2Fsegres/lists"}