Client
Summary
The client stack provides metadata-driven UI and data access for Benevia applications.
Benevia.Core.Clientis the UI-agnostic data layer (OData client, graph definitions, datasets, model metadata). It can be used without Blazor (e.g., in a MAUI app or test harness).Benevia.Core.Blazoris the Blazor UI layer (DataGraph,PropertyComponent, collection components, and list views). It depends onBenevia.Core.Clientand adds the Blazor-specific rendering.
Foundations
Read these first:
Reference
Data layer
Page and component model
- Building a Complete Page
- DataGraph: Define the data shape
- PropertyComponent: Display a property based on the server's meta data.
- PropertyGroup: A component that displays a list of properties
- Method Buttons
- Showing Method Results
- Custom Components: Create your own property components for different types of properties.
- Composable Pages: Create different parts of a page and compose them when multiple features build and extend a page.
Collections and specialized components
- Collection Properties: Inline collection grids, column templates, row actions
- Tags: Tag/chip collection components
- ListView: Full-featured entity list grid with search, filtering, grouping, sorting, saved views, and virtualization
Service Registration
using Benevia.Core.Blazor;
using Blazored.LocalStorage;
builder.Services.AddHttpClient("Api", client =>
{
client.BaseAddress = new Uri(builder.Configuration["ApiBaseUrl"]!);
});
builder.Services.AddScoped(sp =>
sp.GetRequiredService<IHttpClientFactory>().CreateClient("Api"));
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddCoreBlazor(); // Registers Client + Blazor services + MudBlazor + component mappings