public async Task <IList <ChatSummaryModel> > GetChannelsAsync() { var request = new GetChatsListRequest(_chatConfig.ApiUrl); var result = await _httpClient.GetModelOrExceptionAsync <IList <ChatSummaryModel>, IList <ChannelSummaryResponse> >(request, _logger, x => x.Select(Mapper.DtoToChatSummary).ToList()).ConfigureAwait(false); return(result.Model); }
public static async Task <TModel> GetModelAsync <TModel, TDto>( this IRestHttpClient restHttpClient, BaseRestRequest request, ILogger logger, Func <TDto, TModel> dtoToModelConverter) { var result = await restHttpClient.GetModelOrExceptionAsync(request, logger, dtoToModelConverter); return(result.Model); }