Davish.Sendr 是一個 .NET 的 mediator(中介者)函式庫。它會將 request/response 訊息與 async stream 分派給恰好一個 handler,將 notification 發佈給任意數量的 handler,並可用 decorator pipeline 包裝上述任何一種。Handler 可以手動註冊,也可以透過 Roslyn source generator 在編譯期自動發現,兩種方式都不會在執行期掃描 assembly。

支援 netstandard2.0 與 net10.0。

dotnet add package Davish.Sendr

從這裡開始

套件一覽

套件用途
Davish.SendrRequest/response 與 stream 分派、notification 發佈、decorator pipeline。
Davish.Sendr.Abstractions只有合約(contracts):IRequest、ICommand、IQuery、INotification、ISender 等,讓 domain 組件不需要依賴 DI 實作。
Davish.Sendr.Generators選用的 Roslyn source generator,用於編譯期 handler 發現與 reflection-free 分派。

Davish.Sendr.Message、Davish.Sendr.Notification、Davish.Sendr.Notification.Abstractions 是已棄用的相容性套件,請見 從已棄用套件遷移以及完整的 套件參考。