public async Task OnGetAsync(string stub) { Breadcrums.Add(new Breadcrum(stub, $"/Developers/{stub}")); var dataCategories = await _cacheManager.DataCategories.Get(); var stubDataCategory = dataCategories .FirstOrDefault(dc => dc.Stub.Equals(stub, StringComparison.OrdinalIgnoreCase)); if (stubDataCategory != null) { DataCategory = stubDataCategory; } }
public void OnGet(string stub) { Breadcrums.Add(new Breadcrum(stub, $"/Charts/{stub}")); }
public IndexModel() { Breadcrums.Add(new Breadcrum("Charts", "/Charts")); }
public DevelopersModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("Developers", "")); }
public ResearchDevelopmentModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("R&D", string.Empty)); }
public ChartsModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("Charts", "")); }
public AboutModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("About", "")); }
public HelpModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("Help", string.Empty)); }
public async Task OnGetAsync(string dataCategoryStub, string dataSetStub) { Breadcrums.Add(new Breadcrum(dataCategoryStub, $"/Developers/{dataCategoryStub}")); Breadcrums.Add(new Breadcrum("View", $"/Developers/{dataCategoryStub}/{dataSetStub}")); var dataCategories = await _cacheManager.DataCategories.Get(); var stubDataCategory = dataCategories .FirstOrDefault(dc => dc.Stub.Equals(dataCategoryStub, StringComparison.OrdinalIgnoreCase)); if (stubDataCategory == null) { return; } DataCategory = stubDataCategory; var stubDataSet = DataCategory.DataSets .FirstOrDefault(ds => ds.Stub.Equals(dataSetStub, StringComparison.OrdinalIgnoreCase)); DataSet = stubDataSet; if (DataSet == null) { return; } try { if (DataSet.Live) { var liveData = await _cacheManager.GetLiveDataCache(); var json = string.Empty; switch (DataSet.Filename) { case LiveDataCache.FlightsArrivals: json = System.Text.Json.JsonSerializer.Serialize(liveData.AirportArrivals); break; case LiveDataCache.FlightsDepartures: json = System.Text.Json.JsonSerializer.Serialize(liveData.AirportDepartures); break; case LiveDataCache.SailingsHarbour: json = System.Text.Json.JsonSerializer.Serialize(liveData.Harbour); break; } DataTable = JsonConvert.DeserializeObject <DataTable>(json); } else { DataTable = JsonConvert.DeserializeObject <DataTable>(DataSet.CurrentDataJson.Json); } } catch (Exception ex) { Log.Error(ex, "Exception parsing JSON to DataTable [{dataCategoryStub} - {dataSetStub}]", dataCategoryStub, dataSetStub); Error = true; } }
public DataViewModel(CacheManager cacheManager) { Breadcrums.Add(new Breadcrum("Developers", "/Developers")); _cacheManager = cacheManager; }
public void OnGet() { Breadcrums.Add(new Breadcrum("Buses", $"/Charts/Buses")); }
public BusesModel() { Breadcrums.Add(new Breadcrum("Charts", "/Charts")); }
public Housing() { Breadcrums.Add(new Breadcrum("Charts", "/Charts")); Breadcrums.Add(new Breadcrum("Housing", $"/Charts/Housing")); }
public MapsModel(ILogger <PrivacyModel> logger) { _logger = logger; Breadcrums.Add(new Breadcrum("Maps", string.Empty)); }