Ignore:
Timestamp:
10/21/21 19:16:53 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Children:
3b395c5
Parents:
9885bee
Message:

Added unit of work pattern

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FinkiChattery/FinkiChattery.Queries/Questioning/GetQuestionState/GetQuestionStateQuery.cs

    r9885bee r95d80e4  
    11using FinkiChattery.Common.Mediator.Contracs;
    2 using FinkiChattery.Persistence.Repositories;
    32using FinkiChattery.Persistence.Repositories.Contracts;
     3using FinkiChattery.Persistence.UnitOfWork;
    44using System;
    55using System.Threading;
     
    2020    public class GetQuestionStateQueryHandler : IQueryHandler<GetQuestionStateQuery, QuestionStateDto>
    2121    {
    22         public GetQuestionStateQueryHandler(IQuestionRepo questionRepo)
     22        public GetQuestionStateQueryHandler(IUnitOfWork unitOfWork)
    2323        {
    24             QuestionRepo = questionRepo;
     24            UnitOfWork = unitOfWork;
    2525        }
    2626
    27         public IQuestionRepo QuestionRepo { get; }
     27        public IUnitOfWork UnitOfWork { get; }
    2828
    2929        public async Task<QuestionStateDto> Handle(GetQuestionStateQuery request, CancellationToken cancellationToken)
    3030        {
    31             return await QuestionRepo.GetQuestionState(request.QuestionUid);
     31            return await UnitOfWork.Questions.GetQuestionState(request.QuestionUid);
    3232        }
    3333    }
Note: See TracChangeset for help on using the changeset viewer.