dev
Last change
on this file since b25b9ea was b25b9ea, checked in by Стојков Марко <mst@…>, 3 years ago |
Get question state endpoint
|
-
Property mode
set to
100644
|
File size:
1020 bytes
|
Line | |
---|
1 | using FinkiChattery.Common.Mediator.Contracs;
|
---|
2 | using FinkiChattery.Persistence.Repositories;
|
---|
3 | using FinkiChattery.Persistence.Repositories.Contracts;
|
---|
4 | using System;
|
---|
5 | using System.Threading;
|
---|
6 | using System.Threading.Tasks;
|
---|
7 |
|
---|
8 | namespace FinkiChattery.Queries.Questioning
|
---|
9 | {
|
---|
10 | public class GetQuestionStateQuery : IQuery<QuestionStateDto>
|
---|
11 | {
|
---|
12 | public GetQuestionStateQuery(Guid questionUid)
|
---|
13 | {
|
---|
14 | QuestionUid = questionUid;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public Guid QuestionUid { get; }
|
---|
18 | }
|
---|
19 |
|
---|
20 | public class GetQuestionStateQueryHandler : IQueryHandler<GetQuestionStateQuery, QuestionStateDto>
|
---|
21 | {
|
---|
22 | public GetQuestionStateQueryHandler(IQuestionRepo questionRepo)
|
---|
23 | {
|
---|
24 | QuestionRepo = questionRepo;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public IQuestionRepo QuestionRepo { get; }
|
---|
28 |
|
---|
29 | public async Task<QuestionStateDto> Handle(GetQuestionStateQuery request, CancellationToken cancellationToken)
|
---|
30 | {
|
---|
31 | return await QuestionRepo.GetQuestionState(request.QuestionUid);
|
---|
32 | }
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.