public override async Task<GetMeaningForContextRequest> HandleAsync(GetMeaningForContextRequest command, CancellationToken cancellationToken = new CancellationToken())
 {
     var query = new GetMeaningByContextQuery { DictionaryId = command.DictionaryId, WordId = command.WordId, Context = command.Context };
     var result = await _queryProcessor.ExecuteAsync(query, cancellationToken);
     command.Result = result.Select(x => _meaningRenderer.Render(x, command.DictionaryId));
     return await base.HandleAsync(command, cancellationToken);
 }
Example #2
0
        public override async Task <GetMeaningByIdRequest> HandleAsync(GetMeaningByIdRequest command, CancellationToken cancellationToken = new CancellationToken())
        {
            var query = new GetMeaningByIdQuery {
                DictionaryId = command.DictionaryId, MeaningId = command.MeaningId
            };
            var result = await _queryProcessor.ExecuteAsync(query, cancellationToken);

            command.Result = _meaningRenderer.Render(result, command.DictionaryId);

            return(await base.HandleAsync(command, cancellationToken));
        }