FastProjects.Endpoints
1.0.8
dotnet add package FastProjects.Endpoints --version 1.0.8
NuGet\Install-Package FastProjects.Endpoints -Version 1.0.8
<PackageReference Include="FastProjects.Endpoints" Version="1.0.8" />
paket add FastProjects.Endpoints --version 1.0.8
#r "nuget: FastProjects.Endpoints, 1.0.8"
// Install FastProjects.Endpoints as a Cake Addin #addin nuget:?package=FastProjects.Endpoints&version=1.0.8 // Install FastProjects.Endpoints as a Cake Tool #tool nuget:?package=FastProjects.Endpoints&version=1.0.8
To configure the repository template:
- Update workflows. If you use CodeQL, rename the
codeql.yml.example
tocodeql.yml
. - Create a solution file and add projects to
.src/
or.tests/
folders. - Fill the information in
.nuspec
file about nuget package. - Update
README.md
file (also, remove this section).
π FastProjects.Endpoints
π¨ ALERT: Project Under Development This project is not yet production-ready and is still under active development. Currently, it's being used primarily for personal development needs. However, contributions are more than welcome! If you'd like to collaborate, feel free to submit issues or pull requests. Your input can help shape the future of FastProjects!
π Overview
Collection of endpoint base classes that wraps FastEndpoints classes and integrated with MediatR and Result patterns.
Complete documentation of the FastEndpoints can be found here.
π Roadmap
- β FastEndpoint - Base class for endpoints that uses MediatR and Result patterns with response body
- β FastEndpointWithoutResponse - Base class for endpoints that uses MediatR and Result patterns without response body
π Installation
You can download the NuGet package using the following command to install:
dotnet add package FastProjects.Endpoints
Usage
Example of dummy create project use-case implementation:
// Application layer below implemented via MediatR
public sealed record CreateProjectCommand(string Name) : ICommand;
public sealed class CreateProjectCommandHandler : SharedKernel.ICommandHandler<CreateProjectCommand>
{
public async Task<Result> Handle(CreateProjectCommand request, CancellationToken cancellationToken)
{
await Task.Delay(1, cancellationToken);
return Result.Success();
}
}
// Presentation layer below implemented via FastEndpoints
public sealed class CreateProjectRequest
{
public const string Route = "/projects";
public static string BuildRoute() => Route;
public string Name { get; set; }
}
public sealed class CreateProjectValidator : Validator<CreateProjectRequest>
{
public CreateProjectValidator()
{
RuleFor(x => x.Name).NotEmpty();
}
}
public sealed class CreateProjectEndpoint(IMediator mediator)
: FastEndpointWithoutResponse<CreateProjectRequest,
CreateProjectCommand,
Result>(mediator)
{
public override void Configure()
{
Post(CreateProjectRequest.Route);
Version(0);
AllowAnonymous();
Summary(s =>
{
s.ExampleRequest = new CreateProjectRequest { Name = $"Test Project" };
});
}
protected override CreateProjectCommand CreateMediatorCommand(CreateProjectRequest request) =>
new(request.Name);
}
More example can be found in sample TestApp project.
π€ Contributing
This project is still under development, but contributions are welcome! Whether youβre opening issues, submitting pull requests, or suggesting new features, we appreciate your involvement. For more details, please check the contribution guide. Letβs build something amazing together! π
π License
FastProjects is licensed under the MIT License. See the LICENSE file for full details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- FastEndpoints (>= 5.29.0)
- FastProjects.ResultPattern (>= 1.0.7)
- MediatR (>= 12.4.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.