コード例 #1
0
        public async Task <IApiResult> Handle(ListInviteCommand command, CancellationToken cancellationToken)
        {
            var pagedInvites = await _inviteRepository.PaginateAsync(
                predicate : x =>
                (command.MemberId == null || x.MemberId == command.MemberId) &&
                (command.GuildId == null || x.GuildId == command.GuildId),
                top : command.PageSize,
                page : command.Page,
                cancellationToken);

            pagedInvites.SetAppliedCommand(command);
            return(new SuccessResult(pagedInvites));
        }