FastModule.User
1.0.0
See the version list below for details.
dotnet add package FastModule.User --version 1.0.0
NuGet\Install-Package FastModule.User -Version 1.0.0
<PackageReference Include="FastModule.User" Version="1.0.0" />
paket add FastModule.User --version 1.0.0
#r "nuget: FastModule.User, 1.0.0"
// Install FastModule.User as a Cake Addin #addin nuget:?package=FastModule.User&version=1.0.0 // Install FastModule.User as a Cake Tool #tool nuget:?package=FastModule.User&version=1.0.0
FastModule
FastModule is a lightweight, extensible, and modular package designed to simplify the development of modular applications in .NET. It provides a foundation for building applications with independent, self-contained modules, promoting reusability, scalability, and maintainability.
Getting Started
To see FastModule in action, check out the FastModule.Host.Api
project in this repository. The samples demonstrate elegant extensions around common ASP.NET Core types.
Installation
Install FastModule via NuGet:
dotnet add package FastModule.Core
Features
- Minimal API Support: Uses
IEndpointRouteBuilder
for defining routes. - Automatic Module Discovery: FastModule scans and registers implementations automatically.
- Dependency Injection: Built-in support for DI.
- Database Configuration: Easily configure database connections.
Routing
FastModule utilizes IEndpointRouteBuilder
and supports all IEndpointConventionBuilder
extensions (Minimal APIs). For example, defining a route with authorization:
Usage
app.MapGet("/", () => "Hello World!");
Creating a Module
// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddFastModule();
var app = builder.Build();
app.MapFastModules();
app.Run();
// UserModule.cs
public class UserModule : FastModule
{
public override IEndpointRouteBuilder AddRoutes(IEndpointRouteBuilder app)
{
var users = app.MapGroup("/api").WithTags("users");
users.MapGet("/users", async (UserDbContext dbContext) =>
{
return await dbContext.Users.ToListAsync();
});
return app;
}
}
Run the application:
dotnet run
Configuration
FastModule automatically scans for implementations and registers them for DI. However, for more control, you can manually register services in the Register
method and configure database connections in AddFastModule
:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddFastModule(options =>
{
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"),
x => x.MigrationsHistoryTable("ef_migrations"));
});
Join the Community
Have questions or need help? Join our Discord channel to connect with other developers and get support!
FastModule is designed to make modular development in .NET simpler and more efficient. Contributions and feedback are welcome!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net9.0
- FastModule.Core (>= 1.0.0)
- FastModule.Domain (>= 1.0.0)
- FastModule.EntityFrameworkCore (>= 1.0.0)
- FastModule.Shared (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 9.0.2)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.