DAdmin 0.1.2

dotnet add package DAdmin --version 0.1.2
                    
NuGet\Install-Package DAdmin -Version 0.1.2
                    
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="DAdmin" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DAdmin" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="DAdmin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DAdmin --version 0.1.2
                    
#r "nuget: DAdmin, 0.1.2"
                    
#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.
#:package DAdmin@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DAdmin&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=DAdmin&version=0.1.2
                    
Install as a Cake Tool

DAdmin Component Library

Introduction

This library provides a suite of Blazor components designed to create powerful and visually appealing admin panels with ease. It leverages EF DbContext and its entities to automate much of the admin panel creation. Key components include AdminPanel, MenuItem, DataResource, Aggregator, and TimeChart.

Getting Started

To use these components, first ensure that you have referenced this library in your Blazor Server application. The library uses Entity Framework (EF) DbContext and its entities to generate data grids and other components dynamically.

Program.cs
builder.Services.DAdmin<YourDbContext>();
_imports.razor
@using DAdmin

Components

AdminPanel

The AdminPanel component is the container for your administrative interface. It can automatically use DbContext entities to create a data grid for all DbContext entities when UseContextEntities is set to true.

Usage
  • Basic Usage: <AdminPanel/> creates a default admin panel using integrated EF DbContext.
  • Advanced Usage: Set UseContextEntities="true" to enable automatic generation of data grids for each entity in your DbContext.
<AdminPanel UseContextEntities="true">
    <MenuItem Name="Transactions" MenuSection="MenuSection.Resources">
        <DataResource TEntity="Transaction" ExcludedProperties="@(new[] { "Status", "Username" })">
            <Aggregators>
                <Aggregator TEntity="Transaction" AggregationSelector="x => x.Amount" Aggregate="DataGridAggregateType.Sum"/>
            </Aggregators>
        </DataResource>
    </MenuItem>
    <MenuItem Name="Transactions Charts" MenuSection="MenuSection.Charts">
        <TimeChart TEntity="Transaction"
                   Name="Transaction Activity"
                   ChartType="ChartType.Line"
                   AggregationType="AggregationType.Count"
                   AggregationSelector="entity => entity.Id"
                   LabelSelector="entity => entity.CreatedAt"
                   TimeInterval="ChartTimeInterval.Monthly"
                   QueryLogic="query => query"/>
    </MenuItem>
</AdminPanel>

MenuItem defines an individual item in the admin panel, typically linked to a data resource.

Usage
<MenuItem Name="Transactions" MenuSection="MenuSection.Resources" IconClass="fa fa-table">
    
</MenuItem>

DataResource

DataResource connects a data entity to a menu item, allowing for data-driven components within the admin panel.

Usage
<DataResource TEntity="Transaction" ResourceName="Transactions" ExcludedProperties="@(new[] { "Status", "Username" })">
    
</DataResource>

Aggregator

Aggregator is used within DataResource for aggregating data like sums or averages.

Usage
<Aggregator TEntity="Transaction" AggregationSelector="x => x.Amount" Aggregate="DataGridAggregateType.Sum"/>

TimeChart

TimeChart provides a way to visualize data over time, such as line charts or bar graphs.

Usage
<TimeChart TEntity="Transaction"
           Name="Transaction Activity"
           ChartType="ChartType.Line"
           AggregationType="AggregationType.Count"
           AggregationSelector="entity => entity.Id"
           LabelSelector="entity => entity.CreatedAt"
           TimeInterval="ChartTimeInterval.Monthly"
           QueryLogic="query => query"/>

We welcome contributions to this library. Please follow the standard procedures for submitting issues and pull requests.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.