示例#1
0
 public async Task<TImplementation> SendAsync<TImplementation, TModel>(
     IOsuApiRequest request,
     CancellationToken token = default)
     where TModel : class
 {
     var model = await SendAsync<TModel>(request, token).ConfigureAwait(false);
     return OsuSharpMapper.Transform<TImplementation, TModel>(model, request.Client);
 }
示例#2
0
 public async Task<IReadOnlyList<TImplementation>> SendMultipleAsync<TImplementation, TModel>(
     IOsuApiRequest request,
     CancellationToken token = default)
     where TModel : class
 {
     var model = await SendAsync<List<TModel>>(request, token).ConfigureAwait(false);
     return model
         .Select(x => OsuSharpMapper.Transform<TImplementation, TModel>(x, request.Client))
         .ToList()
         .AsReadOnly();
 }