14 lines
621 B
C#
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();
|
|
}
|