示例#1
0
        public static Task <ServiceResult <GetWidgetsResponseDto> > GetWidgetsAsync(this IExampleApi service, string query = null, int?limit = null, WidgetField?sort = null, bool?desc = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new GetWidgetsRequestDto {
                Query = query, Limit = limit, Sort = sort, Desc = desc
            };

            return(service.GetWidgetsAsync(request, cancellationToken));
        }
        public async Task <ServiceResult <GetWidgetsResponseDto> > GetWidgetsAsync(GetWidgetsRequestDto request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            return(ServiceResult.Success(await m_repository.GetWidgetsAsync(request, cancellationToken).ConfigureAwait(false)));
        }