Add MassData feature with API, paging, and Blazor grid
Introduces MassData management to backend and Blazor frontend: - Adds API endpoint for MassData count and paging - Updates repository and controller for count support - Implements MediatR query/handler for count - Adds Blazor page and grid for viewing/editing MassData - Registers MassDataApiClient and integrates with DI - Supports paging, upsert, and UI feedback in grid
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using DbFirst.Application.Repositories;
|
||||
using MediatR;
|
||||
|
||||
namespace DbFirst.Application.MassData.Queries;
|
||||
|
||||
public class GetMassDataCountHandler : IRequestHandler<GetMassDataCountQuery, int>
|
||||
{
|
||||
private readonly IMassDataRepository _repository;
|
||||
|
||||
public GetMassDataCountHandler(IMassDataRepository repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public async Task<int> Handle(GetMassDataCountQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
return await _repository.GetCountAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
using MediatR;
|
||||
|
||||
namespace DbFirst.Application.MassData.Queries;
|
||||
|
||||
public record GetMassDataCountQuery : IRequest<int>;
|
||||
@@ -4,6 +4,7 @@ namespace DbFirst.Application.Repositories;
|
||||
|
||||
public interface IMassDataRepository
|
||||
{
|
||||
Task<int> GetCountAsync(CancellationToken cancellationToken = default);
|
||||
Task<List<Massdata>> GetAllAsync(int? skip = null, int? take = null, CancellationToken cancellationToken = default);
|
||||
Task<Massdata?> GetByCustomerNameAsync(string customerName, CancellationToken cancellationToken = default);
|
||||
Task<Massdata> UpsertByCustomerNameAsync(string customerName, decimal amount, bool statusFlag, string category, CancellationToken cancellationToken = default);
|
||||
|
||||
Reference in New Issue
Block a user