public async Task <ActionResult> Index(string droneInputModel) { List <DroneOutputModel> FinalDroneCoordinates = new List <DroneOutputModel>(); FinalDroneCoordinates = await droneNavigationService.GetDroneCoordinatesFromApi(droneInputModel); return(View(FinalDroneCoordinates)); }
public async Task <ActionResult> Index(string droneInputModel) { DroneOutputViewModel finalDroneCoordinates = new DroneOutputViewModel(); try { //TODO - Serverside validation var errorMessage = ValidateInputValues(droneInputModel); if (String.IsNullOrEmpty(errorMessage)) { finalDroneCoordinates.DroneOutputs = await droneNavigationService.GetDroneCoordinatesFromApi(droneInputModel); } finalDroneCoordinates.ErrorMessage = errorMessage; } catch (Exception ex) { //Log the error message finalDroneCoordinates.ErrorMessage = "Error occured.Please contact Administrator"; } return(View(finalDroneCoordinates)); }