HopFrame Web module
This module contains useful helpers for Blazor Apps and an Admin Dashboard.
How to use the Blazor API
-
Add the HopFrame.Web library to your project
dotnet add package HopFrame.Web -
Create a DbContext that inherits the
HopDbContextand add a data sourcepublic class DatabaseContext : HopDbContextBase { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { base.OnConfiguring(optionsBuilder); optionsBuilder.UseSqlite("..."); } } -
Add the DbContext and HopFrame to your services
builder.Services.AddDbContext<DatabaseContext>(); builder.Services.AddHopFrame<DatabaseContext>(); -
Add the authentication middleware to your app
app.UseMiddleware<AuthMiddleware>(); -
Add the HopFrame pages to your Razor components
app.MapRazorComponents<App>() .AddHopFrameAdminPages() .AddInteractiveServerRenderMode();