public async Task <SearchResult <NotificationDefResult> > Handle(SearchNotificationDefQuery request, CancellationToken cancellationToken)
        {
            var result = await _notificationDefQueryRepository.Search(new SearchNotificationDefParameter
            {
                Count      = request.Count,
                Order      = request.Order,
                OrderBy    = request.OrderBy,
                StartIndex = request.StartIndex
            }, cancellationToken);

            return(new SearchResult <NotificationDefResult>
            {
                Count = result.Count,
                StartIndex = result.StartIndex,
                TotalLength = result.TotalLength,
                Content = result.Content.Select(_ => NotificationDefResult.ToDto(_))
            });
        }
Example #2
0
        public async Task <IActionResult> Search([FromBody] SearchNotificationDefQuery parameter, CancellationToken token)
        {
            var result = await _mediator.Send(parameter, token);

            return(new OkObjectResult(result));
        }