コード例 #1
0
ファイル: HomeController.cs プロジェクト: prajeeesh/DroneTest
        public async Task <ActionResult> Index(string droneInputModel)
        {
            List <DroneOutputModel> FinalDroneCoordinates = new List <DroneOutputModel>();

            FinalDroneCoordinates = await droneNavigationService.GetDroneCoordinatesFromApi(droneInputModel);

            return(View(FinalDroneCoordinates));
        }
コード例 #2
0
        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));
        }