Exemplo n.º 1
0
        public async Task <Result> LoadAllCitizensAsync()
        {
            if (!_citizensRepository.HasCitizensLocally)
            {
                IsBusy = true;

                var result = await _citizensService.GetAllAsync();

                if (result.IsFailure)
                {
                    return(Result.Fail(result.Error));
                }

                _citizensRepository.SaveCitizens(result.Value);

                IsBusy = false;
            }

            return(Result.Ok());
        }