{"id":20135563,"url":"https://github.com/ivanpaulovich/fluentmediator","last_synced_at":"2025-04-09T17:33:23.055Z","repository":{"id":79498840,"uuid":"213090987","full_name":"ivanpaulovich/FluentMediator","owner":"ivanpaulovich","description":":twisted_rightwards_arrows: FluentMediator is an unobtrusive library that allows developers to build custom pipelines for Commands, Queries and Events.","archived":false,"fork":false,"pushed_at":"2020-02-04T18:55:07.000Z","size":1194,"stargazers_count":192,"open_issues_count":5,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-07-31T21:53:32.346Z","etag":null,"topics":["chain-methods","chain-of-responsibility","craftmanship","csharp","ddd-cqrs","dotnet-core","event-driven","event-handlers","event-sourcing","fluent-design","fluent-interface","mediator-pattern","message-bus","pipeline-framework","pipelines","tdd"],"latest_commit_sha":null,"homepage":"http://paulovich.net/FluentMediator/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanpaulovich.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"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}},"created_at":"2019-10-06T00:53:31.000Z","updated_at":"2024-07-12T23:41:04.000Z","dependencies_parsed_at":"2023-04-03T17:47:48.052Z","dependency_job_id":null,"html_url":"https://github.com/ivanpaulovich/FluentMediator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2FFluentMediator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2FFluentMediator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2FFluentMediator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2FFluentMediator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanpaulovich","download_url":"https://codeload.github.com/ivanpaulovich/FluentMediator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248077651,"owners_count":21044002,"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":["chain-methods","chain-of-responsibility","craftmanship","csharp","ddd-cqrs","dotnet-core","event-driven","event-handlers","event-sourcing","fluent-design","fluent-interface","mediator-pattern","message-bus","pipeline-framework","pipelines","tdd"],"created_at":"2024-11-13T21:15:35.804Z","updated_at":"2025-04-09T17:33:22.721Z","avatar_url":"https://github.com/ivanpaulovich.png","language":"C#","readme":"# FluentMediator\n[![Build Status](https://ivanpaulovich.visualstudio.com/FluentMediator/_apis/build/status/ivanpaulovich.FluentMediator?branchName=master)](https://ivanpaulovich.visualstudio.com/FluentMediator/_build/latest?definitionId=24\u0026branchName=master) [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors) ![GitHub issues](https://img.shields.io/github/issues/ivanpaulovich/FluentMediator) ![GitHub pull requests](https://img.shields.io/github/issues-pr/ivanpaulovich/FluentMediator) \u003ca href=\"https://www.nuget.org/packages/FluentMediator/\" rel=\"Paulovich.Caju\"\u003e![NuGet](https://buildstats.info/nuget/FluentMediator)\u003c/a\u003e\n\n:twisted_rightwards_arrows: We will not require you to add dependencies into your domain or to implement frameworks interfaces in your event handlers. Finally a really loosely coupled mediator library was born.\n\n## Install\n\n```\nInstall-Package FluentMediator\n```\n\nFor seameless .NET Core integration:\n\n```\nInstall-Package FluentMediator.Microsoft.Extensions.DependencyInjection\n```\n\n## How\n\nSetup your events and pipelines using depedency injection. You can be very creative here! It supports async methods and cancellable tokens parameters, you could append multiple steps select one to return a message. An example:\n\n```c#\nservices.AddFluentMediator(builder =\u003e {\n    builder.On\u003cPingRequest\u003e().Pipeline()\n        .Call\u003cIPingHandler\u003e((handler, request) =\u003e handler.MyMethod(request))\n        .Call\u003cIPingHandler\u003e((handler, request) =\u003e handler.MyLongMethod(request))\n        .Return\u003cPingResponse, IPingHandler\u003e(\n            (handler, request) =\u003e handler.MyOtherMethod(request)\n        );\n});\n```\n\nThen you are able to use the injected `IMediator` interface.\n\n### Publishing Events\n\n```c#\n// Puts the message in the pipeline, calls three handlers.\nmediator.Publish\u003cPingRequest\u003e(ping);\n```\n\n### Sending Commands and Queries\n\n```c#\n// Calls the three handlers then get the response from `MyOtherMethod(PingRequest)`.\nPingResponse response = mediator.Send\u003cPingResponse\u003e(new PingRequest(\"Ping\"));\nConsole.WriteLine(response.Message); // Prints \"Pong\"\n```\n\n## Why\n\nWhen designing *CQRS* or *Event-Driven* applications we need to publish events from the infrastructure layer into the *domain event handlers*. We do not want framework dependencies leaking out to the Model then **FluentMediator** was born. \n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://paulovich.net\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/7133698?v=4\" width=\"100px;\" alt=\"Ivan Paulovich\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIvan Paulovich\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ivanpaulovich/FluentMediator/commits?author=ivanpaulovich\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#design-ivanpaulovich\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"https://github.com/ivanpaulovich/FluentMediator/commits?author=ivanpaulovich\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.carselind.se\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/439028?v=4\" width=\"100px;\" alt=\"Joakim Carselind\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJoakim Carselind\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#review-joacar\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#ideas-joacar\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/vag1830\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1694870?v=4\" width=\"100px;\" alt=\"Vaggelis Mparmpas\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVaggelis Mparmpas\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ivanpaulovich/FluentMediator/commits?author=vag1830\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nPlease contribute with [Issues](https://github.com/ivanpaulovich/FluentMediator/issues), [Wiki](https://github.com/ivanpaulovich/FluentMediator/wiki) and [Samples](https://github.com/ivanpaulovich/FluentMediator/tree/master/samples).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanpaulovich%2Ffluentmediator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanpaulovich%2Ffluentmediator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanpaulovich%2Ffluentmediator/lists"}