/// <summary>
 /// Получить модели изображений
 /// </summary>
 private static async Task <IReadOnlyCollection <ClothesDetailImageViewModelItem> > GetClothesImages(IClothesRestService clothesRestService, int clothesId) =>
 await clothesRestService.GetImage(clothesId).
 WhereContinueTaskAsync(result => result.OkStatus,
                        result => result.Value,
                        _ => new byte[0]).
 MapTaskAsync(clothesDetailImage => new List <ClothesDetailImageViewModelItem>
 {
     new ClothesDetailImageViewModelItem(clothesDetailImage),
     // new ClothesDetailImageViewModelItem(clothesDetailImage)
 });
예제 #2
0
 /// <summary>
 /// Преобразовать изображение в поток
 /// </summary>
 private static async Task <ImageSource> GetImageSource(IClothesRestService clothesRestService, int clothesId) =>
 await clothesRestService.GetImage(clothesId).
 WhereContinueTaskAsync(result => result.OkStatus,
                        result => result.Value,
                        _ => new byte[0]).
 MapTaskAsync(ImageConverter.ToImageSource);