Example #1
0
        public async Task InitStaticData()
        {
            var stops = await _stopService.GetAllStops();

            if (StopTypeCache == null)
            {
                StopTypeCache = new ConcurrentDictionary <int, StopType>();
            }
            if (StopsBase == null)
            {
                StopsBase = new ConcurrentBag <StopBase>();
            }

            StopTypeCache.Clear();
            StopsBase.Clear();
            foreach (var stop in stops)
            {
                StopTypeCache.AddOrUpdate(stop.ID, stop.Type, (id, s) => stop.Type);
                StopsBase.Add(new StopBase {
                    Id = stop.ID, Name = stop.Name.Trim()
                });
            }
        }
Example #2
0
 private async void btAll_Click(object sender, EventArgs e)
 {
     lbStopService.DataSource = await _stopService.GetAllStops();
 }
Example #3
0
 public List <StopDto> GetAll()
 {
     return(_stopService.GetAllStops());
 }