@@ -8,32 +8,13 @@ namespace QueryKit.WebApiTestProject.Features;
88
99public static class GetPersonList
1010{
11- public sealed class Query : IRequest < List < TestingPerson > >
12- {
13- public readonly string FilterInput ;
14- public readonly string SortInput ;
15- public readonly IQueryKitConfiguration QueryKitConfig ;
16-
17- public Query ( string filterInput , string sortInput , IQueryKitConfiguration queryKitConfig = default )
18- {
19- FilterInput = filterInput ;
20- SortInput = sortInput ;
21- QueryKitConfig = queryKitConfig ;
22- }
23- }
11+ public sealed record Query ( string FilterInput , string SortInput , IQueryKitConfiguration QueryKitConfig = default ) : IRequest < List < TestingPerson > > ;
2412
25- public sealed class Handler : IRequestHandler < Query , List < TestingPerson > >
13+ public sealed class Handler ( TestingDbContext testingDbContext ) : IRequestHandler < Query , List < TestingPerson > >
2614 {
27- private readonly TestingDbContext _testingDbContext ;
28-
29- public Handler ( TestingDbContext testingDbContext )
30- {
31- _testingDbContext = testingDbContext ;
32- }
33-
3415 public async Task < List < TestingPerson > > Handle ( Query request , CancellationToken cancellationToken )
3516 {
36- var queryablePeople = _testingDbContext . People ;
17+ var queryablePeople = testingDbContext . People ;
3718 var appliedQueryable = queryablePeople
3819 . ApplyQueryKitFilter ( request . FilterInput , request . QueryKitConfig )
3920 . ApplyQueryKitSort ( request . SortInput , request . QueryKitConfig ) ;
0 commit comments