Files
f9-web-ai-test/backend/F9WebAiTest.Application/CQRS/SYS/Departments/Queries/GetDepartmentAllQuery.cs
T
2026-10-08 10:43:59 +08:00

14 lines
621 B
C#

using F9WebAiTest.Application.Dtos.SYS.Departments;
using F9WebAiTest.Application.Interfaces.Repositories.SYS.Departments;
using MediatR;
namespace F9WebAiTest.Application.CQRS.SYS.Departments.Queries;
public record GetDepartmentAllQuery() : IRequest<List<DepartmentReadDto_View>>;
public class GetDepartmentAllQueryHandler(IDepartmentReadRepository departmentReadRepository) : IRequestHandler<GetDepartmentAllQuery, List<DepartmentReadDto_View>>
{
public async Task<List<DepartmentReadDto_View>> Handle(GetDepartmentAllQuery query, CancellationToken ct)
=> await departmentReadRepository.GetAllAsync();
}