Buddha.NET
1.0.0
See the version list below for details.
dotnet add package Buddha.NET --version 1.0.0
NuGet\Install-Package Buddha.NET -Version 1.0.0
<PackageReference Include="Buddha.NET" Version="1.0.0" />
paket add Buddha.NET --version 1.0.0
#r "nuget: Buddha.NET, 1.0.0"
// Install Buddha.NET as a Cake Addin #addin nuget:?package=Buddha.NET&version=1.0.0 // Install Buddha.NET as a Cake Tool #tool nuget:?package=Buddha.NET&version=1.0.0
Buddha.NET
The meditative Mediator framework for C# and ASP.NET Core
Structure
- Buddha.NET/ - Main project (class library) containing the implementation
- Buddha.NET.AspNetCore/ - Tools for using Buddha.NET with ASP.NET Core (currently only convenience, BuddhaController)
- Buddha.NET.Demo/ - Demo ASP.NET Core Web API project implementing the Mediator pattern with Buddha.NET
Usage
As an example we will create a new ASP.NET Core Web API project (with .NET 5). If you want to see or get the full demo project immediately, look at the "Buddha.NET.Demo/" folder.
Create a new C# project, add Buddha.NET (and Buddha.NET.AspNetCore if needed) as dependencies
Remove the default files (in ASP.NET Core for example: "WeatherForecast.cs" and "WeatherForecastController.cs")
Create Buddha.NET folder structure, we use the following as an example:
- Model/ - Here are your entities.
- Actions/ - Here you add the Mediator actions as sub-folders (eg. GetTodos) and inside them the Request, Response, Command and (if needed) Validator files.
- Controllers/ - Here you add your Controllers.
- Services/ - Here you add any needed services (for CRUD, DB operations, etc.)
Create your first API endpoint (we use "/api/Todos/GetTodos" as an example)
- Add a new folder inside "Actions/" called "GetTodos"
- Inside "Actions/GetTodos/" add "GetTodosRequest.cs", "GetTodosResponse.cs", "GetTodosCommand.cs"
- Inside "Controllers/" add a new empty API controller called "TodosController.cs", let it inherit from "BuddhaController" (base class) and create an empty constructor
Under construction
Future
I will enhance this project further down the line (happy to get comments and issues posted).
Planned:
- Publish as a package on NuGet
- Write unit tests
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Buddha.NET:
Package | Downloads |
---|---|
Buddha.NET.AspNetCore
ASP.NET Core tools and extensions for Buddha.NET |
GitHub repositories
This package is not used by any popular GitHub repositories.