Add Update route controller to fetch charts and adapt model to allow for response parsing
This commit is contained in:
@ -16,6 +16,26 @@ namespace EFB.Models
|
||||
public Chart[] Approach { get; set; }
|
||||
public Chart[] Transition { get; set; }
|
||||
public Chart[] PilotBriefing { get; set; }
|
||||
|
||||
public ChartModel(ChartList response)
|
||||
{
|
||||
General = FillChart(response.General);
|
||||
TextualData = FillChart(response.TextualData);
|
||||
GroundLayout = FillChart(response.GroundLayout);
|
||||
SID = FillChart(response.SID);
|
||||
STAR = FillChart(response.STAR);
|
||||
Approach = FillChart(response.Approach);
|
||||
Transition = FillChart(response.Transition);
|
||||
PilotBriefing = FillChart(response.PilotBriefing);
|
||||
}
|
||||
|
||||
private Chart[] FillChart(ChartsCollection collection){
|
||||
if (collection != null)
|
||||
{
|
||||
return collection.Charts;
|
||||
}
|
||||
return new Chart[]{};
|
||||
}
|
||||
}
|
||||
|
||||
public class Pinned
|
||||
@ -33,4 +53,5 @@ namespace EFB.Models
|
||||
// public string PseudoURL { get; set; }
|
||||
// public string URL { get; set; }
|
||||
// }
|
||||
|
||||
}
|
Reference in New Issue
Block a user