![]() |
VOOZH | about |
dotnet add package FastModule.Keycloak --version 1.0.2
NuGet\Install-Package FastModule.Keycloak -Version 1.0.2
<PackageReference Include="FastModule.Keycloak" Version="1.0.2" />
<PackageVersion Include="FastModule.Keycloak" Version="1.0.2" />Directory.Packages.props
<PackageReference Include="FastModule.Keycloak" />Project file
paket add FastModule.Keycloak --version 1.0.2
#r "nuget: FastModule.Keycloak, 1.0.2"
#:package FastModule.Keycloak@1.0.2
#addin nuget:?package=FastModule.Keycloak&version=1.0.2Install as a Cake Addin
#tool nuget:?package=FastModule.Keycloak&version=1.0.2Install as a Cake Tool
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.
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.
Install FastModule via NuGet:
dotnet add package FastModule.Core
IEndpointRouteBuilder for defining routes.FastModule utilizes IEndpointRouteBuilder and supports all IEndpointConventionBuilder extensions (Minimal APIs). For example, defining a route with authorization:
app.MapGet("/", () => "Hello World!");
// 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
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"));
});
dotnet add package FastModule.Keycloak
// UserModule.cs
[DependsOn(typeof(Keycloak.Module))]
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;
}
}
```sh
dotnet run
curl https://localhost:7167/keycloak/admin/realm/users?page=1&pageSize=10 -H "Authorization Bearer <access_token>"
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 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.