FastModule.User 1.0.0

There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FastModule.User" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FastModule.User --version 1.0.0                
#r "nuget: FastModule.User, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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!

Join us on Discord


FastModule is designed to make modular development in .NET simpler and more efficient. Contributions and feedback are welcome!

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 81 2/28/2025
1.0.1 82 2/27/2025
1.0.0 76 2/26/2025