예제 #1
0
        public IActionResult GetCost(ShowResultDTO showResultDTO)
        {
            var result = this.showResultService.PresentResult(showResultDTO.CityName, showResultDTO.ModuleListDTO);

            if (result.Cost == -1)
            {
                return(StatusCode(417, "Error, propably bad module name"));
            }
            return(Ok(this.showResultService.PresentResult(showResultDTO.CityName, showResultDTO.ModuleListDTO)));
        }
예제 #2
0
        public IHttpActionResult GetCost(ShowResultDTO showResultDTO)
        {
            var result = this.showResultService.PresentResult(showResultDTO.CityName, showResultDTO.ModuleListDTO);

            if (result.Cost == -1)
            {
                return(Content <string>(HttpStatusCode.ExpectationFailed, "Error, probably bad module name"));
            }

            return(Content <ResultCostDTO>(HttpStatusCode.OK, this.showResultService.PresentResult(showResultDTO.CityName, showResultDTO.ModuleListDTO)));
        }