예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private async Task LoadModelPropertiesAsync(FlightDetailsViewModel model)
        {
            // Load any existing flight property values
            model.Properties = await _properties.GetFlightPropertyValuesAsync(model.Id);

            // The model will only contain values for properties where the value
            // has been set. This is not necessarily all available properties but
            // we need controls for all properties to be rendered so we can enter
            // values for them. To achieve this, merge in the list of available
            // properties (with empty values)
            List <FlightProperty> availableProperties = await _properties.GetFlightPropertiesAsync();

            model.MergeProperties(availableProperties);

            model.PropertiesPerRow = _settings.Value.FlightPropertiesPerRow;
        }
        public async Task <IActionResult> Index()
        {
            List <FlightProperty> properties = await _client.GetFlightPropertiesAsync();

            return(View(properties));
        }