コード例 #1
0
        public ActionResult AthletResult([FromForm] AthletViewModel athletResults)
        {
            var athletResult = _athletService.GetAthletFitness(athletResults.id, athletResults.result);

            Console.WriteLine(athletResult.id + " : " + athletResult.result);

            return(Ok(athletResult));
        }
コード例 #2
0
        /// <summary>
        /// Get Athlet Fitness for showing on view
        /// </summary>
        /// <param name="athletId"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public AthletViewModel GetAthletFitness(int athletId, string result)
        {
            var athletResult = new AthletViewModel();
            var athletList   = _athletRepository.GetAthlets();
            int editIndex    = athletList.FindIndex(o => o.id == athletId);

            athletResult.id     = athletList[editIndex].id;
            athletResult.result = result;

            return(athletResult);
        }