982 B
982 B
How to use the Blazor API
This Installation adds all HopFrame pages and services to the application.
-
Add the HopFrame.Web library to your project
dotnet add package HopFrame.Web -
Create a DbContext that inherits the
HopDbContextand add a data source -
Add the HopFrame services to your application, provide the previously created
DatabaseContextthat inherits fromHopDbContextBasebuilder.Services.AddHopFrame<DatabaseContext>(); -
Optional: You can also add your AdminContext
builder.Services.AddAdminContext<AdminContext>(); -
Add the authentication middleware to your app
app.UseMiddleware<AuthMiddleware>(); -
Add the HopFrame pages to your Razor components
app.MapRazorComponents<App>() .AddHopFrameAdminPages() .AddInteractiveServerRenderMode();