Beispiel #1
0
        public async Task <IActionResult> GetTrainingIds()
        {
            int        authorizedId = User.GetUserId();
            var        query        = new GetLearningUserWordsIdQuery(authorizedId);
            List <int> result       = await mediator.Send(query).ConfigureAwait(false);

            return(Ok(result));
        }
Beispiel #2
0
        public static IQueryable <UserWordPair> QueryPairsToLearn(this IQueryable <UserWordPair> userWordPairs, GetLearningUserWordsIdQuery request)
        {
            var currentPeriod = DateTime.UtcNow.AddDays(request.DaysForward);
            var wp            = userWordPairs.WhereUser(request.UserId);
            var pairsToLearn  = wp.SelectPairsToLearn(currentPeriod);

            return(pairsToLearn);
        }