Пример #1
0
        public async Task LoadPlayer(bool isRefreshing)
        {
            Either <PlayerResponse, ErrorResponse> response = await RequestAsync(!isRefreshing, () => _playerRepository.GetPlayer(View.PlayerId));

            response
            .ConfigureNotFound("Player not found")
            .OnSuccess(data => View.ShowPlayer(new PlayerViewModel(data)))
            .OnError(error => View.Error.Show(error));
        }
Пример #2
0
        public async Task LoadPlayers(bool isRefreshing)
        {
            Either <PlayerListResponse, ErrorResponse> response = await RequestAsync(!isRefreshing, _playerRepository.GetPlayers);

            response
            .ConfigureNotFound(data => data.Players.Any( ), "No players found")
            .OnSuccess(data => View.ShowPlayers(new PlayerListViewModel(data)))
            .OnError(error => { View.Error.Show(error); });
        }