EasyBike.Models.Contract.RefreshAsync C# (CSharp) Method

RefreshAsync() public method

public RefreshAsync ( ) : Task
return Task
        public async Task<bool> RefreshAsync()
        {
            try
            {
                var refreshedStations = await InnerRefreshAsync().ConfigureAwait(false);

                for (int i = 0; i < Stations.Count; i++)
                {
                    Stations[i].Loaded = true;
                    for (int y = refreshedStations.Count - 1; y >= 0; y--)
                    {
                        if (Stations[i].Latitude == refreshedStations[y].Latitude && Stations[i].Longitude == refreshedStations[y].Longitude)
                        {
                            if (Stations[i].AvailableBikes != refreshedStations[y].AvailableBikes || Stations[i].AvailableBikeStands != refreshedStations[y].AvailableBikeStands || Stations[i].Status != refreshedStations[y].Status)
                            {
                                Stations[i].IsUiRefreshNeeded = true;
                                Stations[i].AvailableBikes = refreshedStations[y].AvailableBikes;
                                Stations[i].AvailableBikeStands = refreshedStations[y].AvailableBikeStands;
                                Stations[i].Status = refreshedStations[y].Status;
                            }
                            refreshedStations.Remove(refreshedStations[y]);
                            break;
                        }
                    }

                    //await Task.Delay(1).ConfigureAwait(false);
                }
                retryContract = 0;
            }
            catch (Exception e)
            {
                retryContract++;
                //if (retryContract == 3)
                //{
                //    var notificationService = SimpleIoc.Default.GetInstance<INotificationService>();
                //    try
                //    {
                //        notificationService.Notify(new RefreshFailureNotification()
                //        {
                //            Body = "You seems to struggle getting the stations information. It may be either that your network connection isn't healthy, the service provider is down or it has changed. If you think it could be the last option, then contact us and we will investigate. Thumbs up !",
                //            Subject = "Hey !",
                //            ContractName = Name,
                //            Exception = e
                //        });
                //    }
                //    catch
                //    {
                //        // Ignore
                //    }
                //}
            }
            return true;
        }

Same methods

Contract::RefreshAsync ( Station station ) : Task